Skip to content

Instantly share code, notes, and snippets.

@cocoabox
Created November 20, 2023 05:56
Show Gist options
  • Save cocoabox/9c13f4377e8abbf1cc7f2dc958cad6f2 to your computer and use it in GitHub Desktop.
Save cocoabox/9c13f4377e8abbf1cc7f2dc958cad6f2 to your computer and use it in GitHub Desktop.
google 検索結果を duckduckgo に変換するBookmarklet
javascript:(function() { var currentUrl = window.location.href; var searchQueryMatch = currentUrl.match(/q=([^&]+)/); if (searchQueryMatch && searchQueryMatch[1]) { var decodedSearchQuery = decodeURIComponent(searchQueryMatch[1].replace(/\+/g, ' ')); var duckDuckGoUrl = 'https://duckduckgo.com/?t=h_&q=' + encodeURIComponent(decodedSearchQuery); window.location.href = duckDuckGoUrl; } else { window.location.href = 'https://duckduckgo.com/'; } })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment