Page 1 of 1

Generic Surrogate?

Posted: Fri Apr 08, 2011 2:27 am
by Cryosaur
Hey. My question has probably been beaten to death but I'm having trouble crafting a proper search for the info. I want a tested and approved method for NoScript to block scripts on certain sites while allowing GreaseMonkey to fully function. I think I stumbled across a way to do it with a surrogate and a code snippet from a few years ago but I thought I would ask if there is an option I missed or an accepted best practice to do what I want. Here's what I did that seems to work:

noscript.surrogate.generic.sources =

Code: Select all

@*.domain1.com @*.domain2.com
noscript.surrogate.generic.replacement =

Code: Select all

(function() { var stopPropagation = Event.prototype.stopPropagation; Event.prototype.stopPropagation = function() { if (this.type != "DOMContentLoaded") stopPropagation.apply(this); } })();
The sites are Allowed. Is this doing what I want and in the proper way?

Re: Generic Surrogate?

Posted: Wed May 30, 2012 12:08 pm
by Thrawn
I'm no expert on surrogates, but I do know that they work when the real script is blocked, so if you're allowing the target sites, your surrogate won't run.