Extensions
: K-Meleon Web Browser Forum
All about K-Meleon extensions.
Go to:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
[Please, enable JavaScript to see the code]
Enter code:
[quote=siria] Man!! Can't believe how easy that is, after struggling for such a long time and searching around and messing macros and workarounds without success. And now it turns out there's just 1 simple line needed! *dropdead* Continued from here http://kmeleon.sourceforge.net/forum/read.php?1,104538,page=2 ___________________________________________ [b]K-Meleon has a default setting for animated gifs: Play normal, or 1x, or not (=static image). But after a page was already loaded, already animated gifs can't be stopped anymore (KM1.6b2 + older). This macro allows to STOP all already running animated gifs after a page was already loaded.[/b] ___________________________________________ It works beautifully on the "Block Animation" button now, instantly and without any scrolling :) Actually, it isn't specifically to stop animation, but to [b][color=red]stop the whole page![/color][/b] Whatever else that stops... scripts obviously not... perhaps I should rename it? Hmm, funny... Now when hitting the "Block Animation" (=alternative STOP) Button, a currently loading page stops in the middle, that's okay, but the already loaded gifs are still shown moving. Toggling the button ON/OFF again now stops the animations too! Does it have to be fired 2x?? PS: For testing or whatever, you can also just use this as a [b]bookmarklet[/b]: javascript:window.stop() PS2: The keyboard shortcut (Shift+ESC) works sometimes and other times not, no idea why? ___________________________________________ "Installation": Copy the blue text into a new text file, and save it as "KillAnim.kmm" into one of your macros folders. Must NOT have a .txt ending. Restart browser. ___________________________________________ [color=blue]# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2) # # ----------------------------- KillAnim.kmm -------------------------- # K-Meleon has a default setting for animated gifs: Play normal, or 1x, or not (=static image) # But after a page was already loaded, already animated gifs can't be stopped anymore (KM1.6b2 + older) # This macro allows to STOP already running animated gifs (1 or all) after a page was already loaded. # Note: UN-blocking will NOT re-animate them, once killed they'll stay dead until the page is reloaded again ;-) # # VERSION: [b][color=red]v4.01 / 2011-05-29[/color][/b] (by siria) # [b]# MENUS: # Right-click any image > Kill Animation (1 or all) # Or click Tools > Privacy > "Kill Animation" or "Block Animation", or the Animation Button in Privacy Toolbar[/b] # Forum: kmeleon.sf.net/forum/read.php?9,116553 #---------------------------------------------------------------------------- # # [b]TIP:[/b] If you use the lovely Privacy Toolbar, [b]add the "Kill" menu (Flash, Java, Animations) # as right-click context menu on a button, e.g. on the "Kill Flash" button[/b], or the Animation button: # Edit > Configuration > Toolbars # Example for Flash: Replace "macros(JS_killFlash)" with "macros(JS_killFlash)|_Privacy_Kill" # Or example to add whole Privacy Menu on Animation button right-clicks: # "macros(pref_ToggleAnimation)|&Privacy" JS_killAnimation{ macroinfo=_("Stop all animated gif images in this page"); # If extension "Policy Manager" is used, allow this stop command $pref_PolJS="capability.policy.default.javascript.enabled"; $_bak=getpref(STRING,$pref_PolJS); $_bak=="noAccess" ? setpref(STRING,$pref_PolJS,"allAccess"):0; [b]injectJS("window.stop()");[/b] $_bak=="noAccess" ? setpref(STRING,$pref_PolJS,"noAccess"):0; } pref_ToggleAnimation{ macroinfo=_("Toggle image animation"); menuchecked=(getpref(STRING,$pref_Animation)=="none"); togglepref(STRING,$pref_Animation,"normal","none"); &_pref_SyncButtons; statusbar(sub("%s",getpref(STRING,$pref_Animation)=="none"?$off:$on,_("Image animation %s"))); ##### mod. by siria [b]getpref(STRING,$pref_Animation)=="none" ? &JS_killAnimation[/b] : 0; } # Next one is still the long-winded old workaround from v2, to stop just 1 image: KillAnim_1image{ macroinfo="Kill 1 image animation (workaround, sorry, some sites don't work. Opens single image then navigates back and reloads from cache)"; $_killanim1bak=getpref(STRING,"image.animation_mode"); $_killanim2bak=getpref(INT,"browser.cache.check_doc_frequency"); setpref(STRING,"image.animation_mode","none"); setpref(INT,"browser.cache.check_doc_frequency",2); open($ImageURL); $OnLoadOnce=$OnLoadOnce."_KillAnim_1imageB;"; } _KillAnim_1imageB{ id(ID_NAV_BACK); setpref(STRING,"image.animation_mode",$_killanim1bak); setpref(INT,"browser.cache.check_doc_frequency",$_killanim2bak); &_pref_SyncButtons; } _KillAnim_BuildMenu{ # Keyboard shortcut: Shift+ESC (not sure if it works?) setaccel("SHIFT VK_ESCAPE","macros(JS_killAnimation)"); # setmenu(_Privacy_Kill,macro,"Kill Animation",JS_killAnimation,-1); setmenu("ImageView",macro,"Kill Animation (Stop page)",JS_killAnimation,-1); setmenu("ImageView",macro,"Kill Animation (Stop 1)",KillAnim_1image,-1); # Optional: If you also want it on the context menu (right-click) of the Reload button: # setmenu("Reloa&ding",macro,"Kill Animation (Stop)",JS_killAnimation,-1); } #--------------------- BROWSER START ---------------------- $OnInit=$OnInit."_KillAnim_BuildMenu;"; $macroModules=$macroModules."KillAnim;"; [/color][/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
FAQ
English