Generic Surrogate?

Ask for help about NoScript, no registration needed to post
Cryosaur

Generic Surrogate?

Post 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?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16 (.NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.21022; .NET CLR 3.5.30729)
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Generic Surrogate?

Post 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.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (Linux; U; Android 2.2.1; en-gb; GT-S5570 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Post Reply