Blocks all 3rd party scripts from loading on all sites.
<all_urls>
(function () {
const currentHost = location.hostname;
const origAppendChild = Element.prototype.appendChild;
Element.prototype.appendChild = function (el) {
if (el.tagName === 'SCRIPT' && el.src) {
try {
const url = new URL(el.src);
if (url.hostname !== currentHost) {
console.warn('⛔ Blocked all 3rd-party script:', el.src);
return el;
}
} catch (_) {}
}
return origAppendChild.call(this, el);
};
})();
Install requires the InjectJS Chrome extension. Scripts run only on sites matching the pattern above. Review code before installing any community script.