Toggle highlighting in Results.

Here users can share their specific solutions, e.g. how they further process the data retrieved from Espacenet.
Any suggestions for additional developments and changes to be requested from the EPO should rather be added to the other categories.
Post Reply

jsfiddler
Posts: 2
Joined: Wed May 12, 2021 9:22 am

Toggle highlighting in Results.

Post by jsfiddler » Wed May 12, 2021 9:30 am

Refering to the post: highlighted-keywords-hinder-quick-reading-8843#p25092, a possible solution would be to use the following bookmarklet, which changes the class of the highlights (<span class="search">HIGHLIGHT</span>), such that the css-rules which highlight those words do not apply anymore and the text can be read more quickly. Furthermore, for the duration of the session, the user choice is stored inside the browsers SessionStorage, in order for the highlights to be restored (toogled) if wanted.

Heres the code:

Code: Select all

javascript:if (!Number(sessionStorage.getItem('searchHighlightToggle'))==1) { sessionStorage.setItem('searchHighlightToggle',1); document.querySelectorAll('.search').forEach(e=>e.setAttribute('class','noHighlighting')); }else { sessionStorage.setItem('searchHighlightToggle',0); document.querySelectorAll('.noHighlighting').forEach(e=>e.setAttribute('class','search')); }


Post Reply