per filter base script src replacement #1255
Comments
In NoScript, this sort of thing is called "surrogate scripts": http://hackademix.net/2011/09/29/script-surrogates-quick-reference/ For browsers other than Firefox, the closest thing I can think of is making a custom UserScript (in TamperMonkey, ViolentMonkey, or your other favorite UserScript environment) for this purpose. |
exactly, with greasemonkey it works on FireFox the earliest inject is @run-at document-start. userscript is executed before page code in firefox, but in chrome it's after page code is executed. it is said that extension is not allowed to slow down page, but i think uBlock get a early chance to replace it |
Are you sure that TamperMonkey can't run at document-start? I remember experimenting with a UserScript for a different purpose (to force emoji fallback), and I noticed a difference between Please link to any relevant discussions. |
1st it does support some kind of "run at document-start" but it's too late, code is already executed, i've created a script that do alert(window.somevariablecreatedbythepage), i expect it to be "undefined" but's a defined value and 2nd, |
http://userscripts-mirror.org/scripts/show/125936 this is exactly what i wanted, no discussion in this url though without beforescriptexecute it's impossible to replace the url. but maybe uBlock can blocking standalone ad script most of the time won't harm the page's function, not even a single error may rise |
for document-start, sometimes it works, sometime it doesn't alert(window.FastClick); it will output function body, or undefined same apples to https://account.cyanogenmod.org/device/ alert(window.google); sometimes object, sometimes undefined. never beforescriptexecute http://userscripts-mirror.org/topics/121108.html https://greasyfork.org/en/scripts/9011-liveleak-html5-player |
Maybe a combination of uBlock and a UserScript would work: Block the original script and supply your own with the dummy functions. With that said, I can imagine a (highly brittle) syntax extension, something like However, maybe this is just out of scope for the extension, because we'd basically be re-creating TamperMonkey here. |
I'd like to replace some bad/evil/ad script src to alternative or dummy one with dummy functions
blocking them works most of the time but in some website other part of the script rely on this script
The text was updated successfully, but these errors were encountered: