maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   Selectively disable JavaScript in MicroB ! (https://talk.maemo.org/showthread.php?t=24405)

lbalogh 2008-10-19 09:34

Selectively disable JavaScript in MicroB !
 
Hey, I think I found something interesting for speeding up Microb.

As we don't have (yet) a NoScript extension to block JavaScript, there is an other way. This page :

http://www.mozilla.org/projects/secu...figPolicy.html

describe how to use configurable security policies to selectively define which JavaScript functions a specific site (or list of site) can call.

There is one exemple that disable JavaScript on ALL sites but some we can define. For example I added this to my ~/.mozilla/microb/prefs.js :

Code:

user_pref("capability.policy.policynames", "jsok");
user_pref("capability.policy.default.javascript.enabled", "noAccess");
user_pref("capability.policy.jsok.sites", "https://www.google.com");
user_pref("capability.policy.jsok.javascript.enabled", "allAccess");

and it worked ! When I visit, for example, Google Reader (https://www.google.com/reader/i), JavaScript is enabled, and on all other sites, it is disabled, which makes MicroB flying ;) Not as user friendly as an extension, but with this trick I'm much less frustrated by the speed of the browser, without sacrifying the usability of some sites that need JS to work.

Sorry if it has already been posted on the forum (yes I did a search !).

iamthewalrus 2008-10-19 10:43

Re: Selectively disable JavaScript in MicroB !
 
Good find! It shouldn't be to hard to whip up a small app for changing those settings graphically...anyone?

lbalogh 2008-10-19 13:16

Re: Selectively disable JavaScript in MicroB !
 
On line :
Code:

user_pref("capability.policy.jsok.sites", "https://www.google.com");
we can put as many sites as we need, for example :

Code:

user_pref("capability.policy.jsok.sites", "http://site1 http://site2 http://site3 http://site4");
I agree that an app or an extension to modify this preference on-the-fly would be so cool !


All times are GMT. The time now is 11:05.

vBulletin® Version 3.8.8