Wikipedia search - Bookmarklet

PHOTO EMBED

Thu Sep 01 2022 19:48:30 GMT+0000 (Coordinated Universal Time)

Saved by @RLMA2

javascript:(function(document) {

function se(d) {

    return d.selection ? d.selection.createRange(1).text : d.getSelection(1)

} 

d = se(document); 

for (i=0; i<frames.length && (d==document || d=='document'); i++) d = se(frames[i].document); 

if (s || d=='document') d = prompt('Enter%20search%20terms%20for%20Wikipedia',''); 

open('https://en.wikipedia.org' + (s ? '/w/index.php?title=Special:Search&search=' + encodeURIComponent(s) : '')).focus();

})();
content_copyCOPY

This example bookmarklet performs a Wikipedia search on any highlighted text in the web browser window. In normal use, the following JavaScript code would be installed to a bookmark in a browser[13] bookmarks toolbar. From then on, after selecting any text, clicking the bookmarklet performs the search.

https://en.wikipedia.org/wiki/Bookmarklet