Improvement requests :  K-Meleon Forum
Use this forum to talk about a feature you're missing. Use the bug tracker to report it if necessary. 
content manipulation (diable rollovere effects)
Posted by: froggy
Date: July 04, 2011 05:14AM

Is there a way to add a toolbar button to enable/disable the "javascript content manipulation" (disable rollovere effects) option. I would like quick access to this without going to F2 > javascript > content manipulation.
But its not one of the options in the tollbars.cfg file.

Can it be added?
Thanks

Options: ReplyQuote
Re: content manipulation (diable rollovere effects)
Posted by: siria
Date: July 04, 2011 05:35AM

Basically no prob, rather fun, a tiny macro that just toggles a pref.

But do you really want a toolbar button?? Have an image for it? Should it show the pressed state? Uhm, starting to turn into "work"... ;-)

Or perhaps you have the Privacy Bar visible, and it would suffice to add this toggle on a right-click menu of the javascript button? That would be a whole lot easier and shorter to code cool smiley

You can already test with an existing menu, the new toggle could become a new line in that menu (or another). If you like, in toolbars.cfg add the blue text to the javascript button:
macros(pref_ToggleJavaScript)|P&ermissions

Hmm... or this one? That's the middle part of Tools>Privacy menu, just the list of "Block"-commands:
macros(pref_ToggleJavaScript)|_Privacy_Settings



Edited 1 time(s). Last edit at 07/04/2011 05:41AM by siria.

Options: ReplyQuote
Re: content manipulation (diable rollovere effects)
Posted by: froggy
Date: July 04, 2011 09:18AM

This helps.
But it seems I must rt. click the java button to get the "content manipulation" window to open. Is there a way to enable/disable the actual "content manipulation" function by simply toggling the toolbar button directly without the extra step?

If not, this will suffice. Thanks.



Edited 4 time(s). Last edit at 07/04/2011 10:14AM by froggy.

Options: ReplyQuote
Re: content manipulation (diable rollovere effects)
Posted by: siria
Date: July 05, 2011 01:43AM

But you haven't installed the little macro yet, which adds the new menu option ;-)

Copy the blue text into notepad and save as "toggleprefImgSrc.kmm" in a macros folder. Make sure to save as "all files" option, must not have a .txt ending!
After restarting the browser the menu will offer "Block Image Roll-Over":
_________________________________

# Creates menu entries for quicker access to "Block Image Roll-Over", from F2 > Javascript options
# Froggy: http://kmeleon.sourceforge.net/forum/read.php?4,117390

toggleprefImgSrc{
macroinfo=_("Disallow scripts to change images (Roll-Over)");
menuchecked=getpref(BOOL,"dom.disable_image_src_set");
togglepref(BOOL,"dom.disable_image_src_set");
}

_toggleprefImgSrc_BuildMenu{
# Insert in menu: Tools > Privacy (between "Block" commands)
setmenu("_Privacy_Settings",macro,"Block Image Roll-Over","toggleprefImgSrc","Block F&lash");
# Insert in menu: Tools > Privacy > Permissions (Exceptions stuff and Javascript options)
setmenu("P&ermissions",macro,"Block Image Roll-Over","toggleprefImgSrc",-1);
}

$OnInit=$OnInit."_toggleprefImgSrc_BuildMenu;";
$macroModules=$macroModules."toggleprefImgSrc;";


________________

You can also use this command now on a toolbar button, would suggest:

macros(toggleprefImgSrc)|_Privacy_Settings

But it only toggles the setting, doesn't stay visibly pressed.



Edited 3 time(s). Last edit at 07/05/2011 02:00AM by siria.

Options: ReplyQuote
Re: content manipulation (diable rollovere effects)
Posted by: froggy
Date: July 05, 2011 02:38AM

Thank you for the information! You're right I hadn't done the macro.

Your macro works great. Great support !

Options: ReplyQuote
Re: content manipulation (diable rollovere effects)
Posted by: siria
Date: July 05, 2011 04:14AM

Great, and this mini-stuff is fun too grinning smiley

Options: ReplyQuote


K-Meleon forum is powered by Phorum.