NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Slashdot Ad-Shield fix
// @version 1.1
// @author Daniel Perelman (perelman@aweirdimagination.net)
// @license MIT
// @icon https://www.google.com/s2/favicons?sz=64&domain=slashdot.org
// @match https://*.slashdot.org/*
// @match https://slashdot.org/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
const w = window.wrappedJSObject || window;
if (window.wrappedJSObject) {
w.eval("window.originalAlert = window.alert")
w.eval("window.originalConfirm = window.confirm")
w.eval("document.originalQuerySelectorAll = document.querySelectorAll")
w.eval(`window.alert = ${() => {
throw Error("Used alert().");
}}`);
w.eval(`window.confirm = ${() => {
throw Error("Used confirm().");
}}`);
w.eval(`document.querySelectorAll = ${(arg) => {
if (arg === "link,style") return document.originalQuerySelectorAll("invalid");
return document.originalQuerySelectorAll(arg);
}}`);
} else {
w.alert("Script only works on GreaseMonkey for Firefox.");
}
})();