General :
K-Meleon Web Browser Forum
General discussion about K-Meleon
Enable/disable js macro
Posted by:
ph.ilou
Date: July 14, 2003 11:32AM
Hello everyone,
I'm looking for a macro that would allow me to enable/disable javascript from K-melon ui, without going to edit/prefs etc. I found one, made by Po (guess it was years ago?), but it causes problems, KM 07 seem not to like it...
Actually, I have a "_Prefs" menu in the menu bar so that i can enable/disable cookies & images — I'd just like to add a "js" item to it.
Anyone has an idea ?
thanks,
ph.
Re: Enable/disable js macro
Posted by:
MonkeeSage
Date: July 15, 2003 08:31AM
ph.:
jsnj posted a macro in the past for a toolbar button to enable/disable javascript and java (if I recall correctly), mabye something like that is what you are looking for?
Shelumi`El
Jordan
S.D.G
Re: Enable/disable js macro
Posted by:
Robert
Date: July 15, 2003 08:42AM
javascript_off {menu = "Javascript off";
setpref(STRING, "capability.policy.default.javascript.enabled", "noAccess");
id(ID_NAV_RELOAD); statusbar("Javascript off");}
javascript_on {menu = "Javascript on";
setpref(STRING, "capability.policy.default.javascript.enabled", "allAccess");
id(ID_NAV_RELOAD); statusbar("Javascript on");}
Gruß Robert
Re: Enable/disable js macro
Posted by:
ph.ilou
Date: July 15, 2003 11:41AM
Thanks to both of you !!
Monkeysage : jsnj's macro is a java on/off macro. Usefull though, thanks again.
Robert : thanks ! I put your macro in macros.cfg, and added items to the "-Prefs" menu
so it looks like this :
&Prefs {
macros(site-cookies)
macros(no-cookies)
-
macros(all-images)
macros(site-images)
macros(no-images)
-
macros(javascript_off)
macros(javascript_on)
}
But clicking "Javascript on" or "off" in the Prefs menu doesn't make the Javascript
button checked/unchecked in the Preferences, neither changes
user_pref("capability.policy.default.javascript.enabled", "noAccess");
to "all access",
or user_pref("javascript.enabled", false); to "true", in prefs.js.
The "Javascript on/off" message appears in the status bar though.
Something must be missing, or i must have made some error.
I'm *very* new to macros, as you may have guessed...
Any idea ?
Cheers,
ph.
Re: Enable/disable js macro
Posted by:
jsnj
Date: July 15, 2003 05:54PM
Re: Enable/disable js macro
Posted by:
ph.ilou
Date: July 15, 2003 07:57PM
Thanks jsnj ("javascript Ninja" ?) for THE link,
... and it works as expected.
Thanks again to you and everyone,
Ciao,
ph.
Re: Enable/disable js macro
Posted by:
MonkeeSage
Date: July 16, 2003 07:00AM
ph.:
Glad you got it working. It's always a good feeling to be able to set things up the way
you like them, instead of being stuck with the lock & stock factory model.
Shelumi`El
Jordan
S.D.G
Re: Enable/disable js macro
Posted by:
ph.ilou
Date: July 16, 2003 08:47AM
)