Page 1 of 1

[RESOLVED] Yahoo stealing focus - noscript messing things up

Posted: Sun May 02, 2010 10:23 pm
by TooCrooked
Hi,

I should be able to prevent yahoo from stealing my focus using the following code in my prefs.js file:

Code: Select all

user_pref("capability.policy.policynames", "nofocus");
user_pref("capability.policy.nofocus.sites", "http://www.yahoo.com http://m.www.yahoo.com");
user_pref("capability.policy.nofocus.HTMLInputElement.focus", "noAccess");
That code verifiably works in a clean install of firefox 3.6.3 (current as of today). the SECOND you install noscript, this code stops functioning. In my test environment as of today, there are two domains that require enablement so that yahoo can do what it does. they are the "yahoo" and "yimg" domains.

I want yahoo to be able to run scripts. i do not want yahoo to be able to change my cursor focus. most importantly, i do not want to globally prevent sites from being able to change the focus; only yahoo. i simply want to keep using noscript like usual, but prevent one domain from doing one thing.

please advise.

Re: Yahoo stealing focus - noscript messing things up

Posted: Mon May 03, 2010 12:14 pm
by Giorgio Maone
NoScript is currently the main and more complex CAPS client, and it's quite difficult to use CAPS for other purposes when NoScript is installed (even if they're theoretically compatible, in practice they're very difficult or nearly impossible to adapt to NoScript's presence).

Furthermore, most if not all the fine-grained CAPS features, beside selective script blocking because of NoScript backward compatibility, are going to be removed in future Firefox versions for performance reasons.

Fortunately you can use Surrogate Scripts for the same purposes (and, in most cases, in a more compatible ways).
In your case,

Code: Select all

user_pref("noscript.surrogate.nofocus.sources", "@.www.yahoo.com");
user_pref("noscript.surrogate.nofocus.replacement", "HTMLInputElement.prototype.focus=function(){}");

Re: Yahoo stealing focus - noscript messing things up

Posted: Tue May 04, 2010 12:24 am
by dhouwn
Giorgio Maone wrote:Furthermore, most if not all the fine-grained CAPS feature, beside selective script blocking because of NoScript backward compatibility, are going to be removed in future Firefox version for performance reason.
Really? :cry:
I couldn't find any Bugzilla entry to this but it sounds reasonable.
I wonder if they could give us as a compensation the right handles to make Noscript's surrogate-script-feature more powerful, e.g. by allowing surrogate scripts to override read-only objects/properties.

Re: Yahoo stealing focus - noscript messing things up

Posted: Tue May 04, 2010 6:22 am
by TooCrooked
Giorgio, i'm in your debt despite the fact that im not familiar with "CAPS". Hopefully this helps other 'netters in the future