Last active
February 21, 2020 23:27
-
-
Save julfers/2511938bdefee03f59984aec2ae9d0ad to your computer and use it in GitHub Desktop.
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
// Moved to https://hg.sr.ht/~julfers/greasemonkey/browse/default/hidew3schools.user.js | |
// ==UserScript== | |
// @name Hide W3 Schools | |
// @namespace http://josiahulfers.com/hideW3schools | |
// @description Removes w3schools search results from DuckDuckGo | |
// @include https://duckduckgo.com/* | |
// @version 3 | |
// @grant none | |
// @updateURL https://hg.sr.ht/~julfers/greasemonkey/raw/default/hidew3schools.user.js | |
// ==/UserScript== | |
setInterval(function () { // interval because results load async | |
var rs = document.getElementsByClassName('result') | |
for (var ri = rs.length - 1; ri >= 0; ri--) { | |
var as = rs[ri].getElementsByTagName('a') | |
for (var ai = as.length - 1; ai >= 0; ai--) { | |
if (/w3schools/.test(as[ai].hostname)) rs[ri].style.display = 'none' | |
} | |
} | |
}, 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment