Last active
May 9, 2024 16:09
-
-
Save Pictor13/7ec054642632478ca562a6e9283bf9ed to your computer and use it in GitHub Desktop.
Tampermonkey userscript to remove the annoying first fake results (they are ADs), form Google SERP
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-google-ads | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove ADs fake-search-results on Google SRP | |
// @author Igor Pellegrini | |
// @include /^https?\:\/\/.*.google\..*\/search.*$/ | |
// @grant GM_log | |
// ==/UserScript== | |
(function() { | |
console.log('Remove annoying AD results'); | |
if (document.getElementById('privatelayer')) { | |
document.getElementById('privatelayer').remove(); // remove iframe with ADs search results | |
Array.prototype.map.call(document.getElementsByClassName('ads-ad'), (el) => el.remove()); | |
if (document.getElementById('search')) document.getElementById('search').style.marginTop = 0; | |
GM_log('Google ADs iframe removed by Tampermonkey script. Check your browser extensions.'); | |
} else { | |
console.log('Nothing annoying to remove'); | |
} | |
})(); |
It unfortunately does not work as of now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wrote a quick script to remove those nerves-tearing AD-results on Google, that occupy the whole vertical viewport and are just distracting and not relevant to the search.
Get your search results back!
PS - Please comment to update the script, in case the Google SERP markup changes and this script doesn't work anymore. Thank you 😉