Skip to content

Instantly share code, notes, and snippets.

@sendarionn
Last active July 26, 2026 03:44
Show Gist options
  • Select an option

  • Save sendarionn/8cbb29cf2678b53bcd65b2ec53f9d6a1 to your computer and use it in GitHub Desktop.

Select an option

Save sendarionn/8cbb29cf2678b53bcd65b2ec53f9d6a1 to your computer and use it in GitHub Desktop.
前後に文字列を追加してGoogleで検索するブックマークレット
javascript:(()=>{const selection=window.getSelection()?.toString();if(!selection)return;const prefix=prompt('検索キーワードの前に追加する文字列','');if(prefix===null)return;const suffix=prompt('検索キーワードの後ろに追加する文字列','');if(suffix===null)return;const query=`${prefix?prefix+' ':''}${selection}${suffix?' '+suffix:''}`;window.open(`https://www.google.com/search?q=${encodeURIComponent(query)}`,'_blank','noopener,noreferrer');})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment