# Only the same again as BACKUP in plain text for wayback archive.
# Unfortunately they stopped archiving macro-files since awhile. Not sure who's culprit, if them or possibly sourceforge, but major desaster for KM :-(
# web.archive.org/web/20200208002319/http://kmeleonbrowser.org/forum/read.php?9,146712
# HOWTO: copy and paste the text below into a new text file (Editor, Notepad, Notepadplus NPP etc,) and save it as:
# ..k-meleon../macros/stylekiller.kmm
# UTF-8 / K-Meleon Macros (http://kmeleonbrowser.org/wiki/MacroLanguage2)
#--------- stylekiller.kmm v1 (2018-07-14)
# Temporarily kill and restore all loaded STYLESHEETS on the current page.
# Restoring works instantly too, without reload, just use the same command.
#
# Killing styles makes the page look ugly but MUCH LIGHTER and faster to scroll.
# Helps low-resource computers and old browsers in today's bloated web,
# when even blocking javascript doesn't help anymore against nearly freezing.
# At least the text gets readable again, FAST, scrolling and selecting works again.
# Sometimes unexpected side-effects for better accessibility (buttons, input fields etc.)
#
# ----------------------------------------------------------
# K-Meleon version: 1.5.4 or newer
# Menu: Tools > Style Killer (Toggle CSS)
# Forum: http://kmeleonbrowser.org/forum/read.php?9,146712
# Button: Optional, Do-it-yourself: in toolbars.cfg, use action "macros(stylekiller)|Stylesheets"
# Shortcut: Optional, Do-it-yourself: choose keys below
# Uninstall: Remove this file from macros folder
# ----------------------------------------------------------
# TIPS:
# 1) Want to block stylesheets globally before LOADING? Just use this pref:
# permissions.default.stylesheet = 1,2,3 (type INT, 1=allow, 2=block, 3=same domain)
# Catch: still loads "embedded" styles. Use StyleKiller to kill those too (after load)
# 2) For blocking this and other stuff by type, take a look at macros priv3buttons, permdefs etc.
# 3) Want this macro as BOOKMARKLET? try this, but may affect top frame only:
# javascript
function(){var i, dss=document.styleSheets; if (dss[0].disabled) {for(i=0;dss[i];++i) dss[i].disabled=false;} else {for(i=0;dss[i];++i) dss[i].disabled=true};})();
# ===========================================
# KEYBOARD SHORTCUT:
$_stylekiller_accel= "" ;
# Just example: $_stylekiller_accel= "CTRL ALT SHIFT VK_F12" ;
# Look inside "accel.cfg" for more examples, and "commands.html" for default shortcuts
#----------------------------------------------------------
stylekiller{
macroinfo="1 page temporary: Kill or restore CSS-StyleSheets";
$JS_doit = "(function(){var i, dss=document.styleSheets; if (dss[0].disabled) {for(i=0;dss[i];++i) dss[i].disabled=false;} else {for(i=0;dss[i];++i) dss[i].disabled=true};})();";
&JS_hndlDocs;
&_pref_SyncButtons;
}
_stylekiller_BuildMenu{
# position: 0 = top / -1 = bottom / 1,2,3,.... =line number
setmenu("&Tools",macro,"Style Killer (Toggle CSS)",stylekiller,0);
setmenu("Stylesheets",macro,"Style Killer (Toggle CSS)",stylekiller,0);
}
_stylekiller_SetAccel{
$_stylekiller_accel=="" ? 0 : setaccel( $_stylekiller_accel ,"macros(stylekiller)") ;
}
#----------------------------------------------------------
$OnInit=$OnInit."_stylekiller_BuildMenu;";
$OnSetup=$OnSetup."_stylekiller_SetAccel;";
$macroModules=$macroModules."stylekiller_v1;";
Edited 1 time(s). Last edit at 11/29/2021 01:33AM by siria.