Hacker News new | ask | show | jobs
by cpleppert 1067 days ago
This bookmarklet will work:

  (function () { let sel = window.getSelection(); let Qr; if (sel && sel.toString().length > 0) {Qr=sel.toString()} else {Qr=prompt('Search Site for','');} let hna=window.location.hostname; if(Qr) {  location.href='http://www.google.com/search?&q=site:'+encodeURIComponent(hna)+'+'+escape(Qr)  }})();
You can attach to a keyboard shortcut with a launcher or applescript.