Last active
September 3, 2025 13:13
-
-
Save pdcmoreira/03cf282bde25eaa72bacc1ba9001082e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Remove StartPage's sponsored results | |
// @namespace http://tampermonkey.net/ | |
// @version 2025-09-03 | |
// @description Remove top and bottom sponsored results from StartPage searches | |
// @author pdcmoreira | |
// @match https://www.startpage.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=startpage.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function waitForElement(id) { | |
return new Promise(resolve => { | |
const element = document.getElementById(id) | |
if (element) { | |
return resolve(element); | |
} | |
const observer = new MutationObserver(mutations => { | |
const element = document.getElementById(id) | |
if (element) { | |
observer.disconnect(); | |
resolve(element); | |
} | |
}); | |
observer.observe(document.body, { | |
childList: true, | |
subtree: true | |
}); | |
}); | |
} | |
['gcsa-top', 'gcsa-bottom'].forEach((id) => { | |
waitForElement(id).then((el) => { | |
el.remove(); | |
}); | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment