Development
: K-Meleon Forum
K-Meleon development related discussions.
Goto:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
[quote=JamesD] [quote=deadlock] Is there anything else to change in that file? [/quote] I use the Mozilla capability policy prefs because I run the Policy Manager extension. In that I have Javascript on in prefs, but have the 'capability.policy.default.javascript.enabled' pref set to' noAccess'. I have made changes to main.kmm so that items like 'Send page as a link', 'zoom image' and other will still work. I don't know what percentage of users use capability policy. I don't think the inclusion of my code would impact anything else. All the lines with $FlipFlip are lines I added to bypass the default for an immediate injectJS. [code] # Parameters for JS_hndlDoc(s) (set those you need before calling the macro): $JS_doit=""; $JS_func=""; $JS_last=""; $JS_fail=""; JS_hndlDocs{ # $JS_doit takes the code to be executed in the context of each frame # $JS_func is the right place for functions and global variables (e.g. when you want to count something over all frames) # $JS_last is the right place for finishing actions (e.g. when you want to alert what you have counted over all frames) # $JS_fail is the right place to handle errors that may occur when accessing a frame (Gecko prevents cross-site scripting) $FlipFlip = false; getpref( STRING, "capability.policy.default.javascript.enabled")=="noAccess" ? $FlipFlip=true : 0 ; $FlipFlip == true ? togglepref( STRING, "capability.policy.default.javascript.enabled", "noAccess", "allAccess") : 0; injectJS("(function(){".$JS_func.$_JS_urlencode."function hndlFrm(w){try{with(w.document){".$JS_doit."}}catch(e){".$JS_fail."}for(var j=0,f=w.frames;j<f.length;j++)hndlFrm(f[j])}hndlFrm(window);".$JS_last."})()"); $FlipFlip == true ? togglepref( STRING, "capability.policy.default.javascript.enabled", "noAccess", "allAccess") : 0; $JS_doit=""; $JS_func=""; $JS_last=""; $JS_fail=""; } JS_hndlDoc{ # Same as JS_hndlDocs, but only for the current frame. $FlipFlip = false; getpref( STRING, "capability.policy.default.javascript.enabled")=="noAccess" ? $FlipFlip=true : 0 ; $FlipFlip == true ? togglepref( STRING, "capability.policy.default.javascript.enabled", "noAccess", "allAccess") : 0; injectJS("(function(){".$JS_func.$_JS_urlencode."with(document){".$JS_doit."}".$JS_last."})()",frame); $FlipFlip == true ? togglepref( STRING, "capability.policy.default.javascript.enabled", "noAccess", "allAccess") : 0; $JS_doit=""; $JS_func=""; $JS_last=""; $JS_fail=""; } JS_hndlTop{ # Same as JS_hndlDoc, but only for the topmost frame (to avoid cross site scripting). $FlipFlip = false; getpref( STRING, "capability.policy.default.javascript.enabled")=="noAccess" ? $FlipFlip=true : 0 ; $FlipFlip == true ? togglepref( STRING, "capability.policy.default.javascript.enabled", "noAccess", "allAccess") : 0; injectJS("(function(){".$JS_func.$_JS_urlencode."with(document){".$JS_doit."}".$JS_last."})()"); $FlipFlip == true ? togglepref( STRING, "capability.policy.default.javascript.enabled", "noAccess", "allAccess") : 0; $JS_doit=""; $JS_func=""; $JS_last=""; $JS_fail=""; } [/code][/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development