Last active
July 6, 2023 15:24
-
-
Save kevinleedrum/4d286da27e63a0eb7e17a36ed2ddd4e8 to your computer and use it in GitHub Desktop.
Replace Google Links with DuckDuckGo Links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Replace Google links with DuckDuckGo links | |
// @namespace https://gist.github.com/kevinleedrum/4d286da27e63a0eb7e17a36ed2ddd4e8 | |
// @version 0.1 | |
// @description Replace Google links on the page with DuckDuckGo links | |
// @author You | |
// @match https://*/* | |
// @exclude https://*google.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=duckduckgo.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
const googleLinks = document.querySelectorAll('a[href^="https://www.google.com/search"]'); | |
googleLinks.forEach(link => { | |
const newUrl = link.href.replace('https://www.google.com/search', 'https://duckduckgo.com'); | |
link.innerText = link.innerText.replace('Google', 'DuckDuckGo'); | |
link.setAttribute('href', newUrl); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment