TooCrooked wrote:i want to simply alert "test" using a fallback surrogate. i created an HTML file on my desktop and added the following line to my user.js file:
Code: Select all
user_pref("noscript.surrogate.test.replacement", "addEventListener('DOMContentLoaded', function(ev) { alert('test')}, true)");
user_pref("noscript.surrogate.test.sources", "!*");
The main problem here is that "fallback" surrogates (those with a "!" in their sources) are already executed in a DOMContentLoaded event handler, therefore yours will never run because gets registered too late.
Just drop the addEventListener call and put your code directly at the top level.
TooCrooked wrote:
of course, since the file is on my desktop, noscript defaultly automatically blocks JS from running (which i dont like, but i digress)
You'd just need to allow file://
[EDIT]
Surrogates don't run on file:// URLs, as al_9x noted and I, instead, forgot (see below).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6