Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Tiny macro to kill-restore CSS: StyleKiller
Posted by: siria
Date: July 15, 2018 12:18AM

One of my most important macros, would be lost without it long since.
Strongly recommend it for everyone struggling with low resource computers and old browser versions, crawling along and nearly freezing on bloated sites, even if JS blocked already. Lately even wikipedia, grmpf. Thought I'd posted this years ago already, but cannot find it anymore. Not sure, perhaps it was only the bookmarklet version in stylescriptia examples.

Macro to 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.
At least the text gets readable again, FAST, scrolling and selecting works again.
Sometimes unexpected side-effects for better accessibility (buttons, input fields etc.)
(can also work as bookmarklet, more description and tips inside)

Menu: Tools > Style Killer (Toggle CSS)
Button/Shortcuts: optional, easy to create yourself
Installation: Drop the attached kmm file into the macros folder.
Uninstall: Remove the file from macros folder again (no traces left)

Attachments: stylekiller.kmm (2.9 KB)  
Options: ReplyQuote
Re: Tiny macro to kill-restore CSS: StyleKiller
Posted by: anonymous
Date: July 16, 2018 07:53PM

@siria
Nice. What happens if you find a site with incompatible styles? Do you select and filter them using Wladimir Palant's "adblockplus.dll" for K-Meleon 1.6, or do you use macros for that as well?

Options: ReplyQuote
Re: Tiny macro to kill-restore CSS: StyleKiller
Posted by: siria
Date: July 22, 2018 01:26AM

Quote
anonymous
Nice. What happens if you find a site with incompatible styles? Do you select and filter them using Wladimir Palant's "adblockplus.dll" for K-Meleon 1.6, or do you use macros for that as well?

Offtopic (Not macro-related) part of discussion was split and continued here:
http://kmeleonbrowser.org/forum/read.php?19,146751



Edited 1 time(s). Last edit at 07/22/2018 02:23AM by siria.

Options: ReplyQuote
Re: Tiny macro to kill-restore CSS: StyleKiller
Posted by: Mello
Date: November 05, 2018 12:03AM

Excellent.

I've just tried stylekiller on a site where the text was too wide for my screen... had to keep scrolling back and forth. If I minimised the font size to get it to fit screen I couldn't read it.

Stylekiller zapped whatever was causing this and the text fitted into the width of my notebook screen even after zooming it up a level in size.

I use a high dpi and lower screen resolution to make things easily
legible for me.

This often makes some software windows appear too large, but I find kde.mover-sizer works well for them
http://corz.org/windows/software/accessories/KDE-resizing-moving-for-Windows.php

Options: ReplyQuote
Re: Tiny macro to kill-restore CSS: StyleKiller
Posted by: Mello
Date: April 02, 2021 01:08AM

I doubt a day passes without me using Stylekiller; it is Very easy on the eye!

The only downside I find is that some pages when freed of their style involve scrolling down a long way to get to the text body, is there a way of introducing - dare I say it - a "style" to truncate this?

Options: ReplyQuote
Re: Tiny macro to kill-restore CSS: StyleKiller
Posted by: siria
Date: April 02, 2021 02:43PM

Quote
Mello
I doubt a day passes without me using Stylekiller; it is Very easy on the eye!

The only downside I find is that some pages when freed of their style involve scrolling down a long way to get to the text body, is there a way of introducing - dare I say it - a "style" to truncate this?

Cool, thanks smiling smiley A user, yay! grinning smiley Sadly us few macrowriters have the impression since forever that hardly anyone uses our macros, if any are even used at all besides the native ones, which has finally lead to an almost complete stop. And user numbers of KM in general seem quite dwindling too.

Regarding the scrolling prob, oh yeah, what a pain! sad smiley
Personally I'm helping myself with a whole bunch of more macro tricks, either hiding or completely removing on-click those endless menus and other bloat, and have thousands of rules in adblock.css. But figuring out those is often tricky and time-consuming too, especially on my ancient KM1x where one site after the other is broken now. Hope to some day get more of those debloating-macros in a state ready to be posted, experimental mess cleaned up, some far day....

For now, my only meager tip is a little macro for URL-defined autoscrolling, for frequently visited sites:
ScrollOnLoad
http://kmeleonbrowser.org/forum/read.php?9,136278
(oops, stoneage version yet! Will upload my current version in the next days, check back...)

Catch: so far browser restarts are required for adding new URL-rules.
Thinking about, it wouldn't be overly complicated to add a few temporary rules too, without restart, stored in aboutconfig-prefsJS, but am too occupied with other probs in these highly destructive times :-(



Edited 1 time(s). Last edit at 04/02/2021 02:49PM by siria.

Options: ReplyQuote
Re: Tiny macro to kill-restore CSS: StyleKiller
Posted by: Mello
Date: April 02, 2021 03:24PM

Thanks siria.

I'm sure more people than you realise make use of your invaluable input.

I use: stylekiller, replacefaketext, hotlinks20 and your useragent macro plus lots of your tweaks here and there.



Take your time and take care.

Options: ReplyQuote
Re: Tiny macro to kill-restore CSS: StyleKiller
Posted by: siria
Date: November 29, 2021 12:37AM

# 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:
# javascriptsad smileyfunction(){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.

Attachments: stylekiller_kmm.zip (1.5 KB)  
Options: ReplyQuote
Re: Tiny macro to kill-restore CSS: StyleKiller
Posted by: JohnHell
Date: November 29, 2021 02:59PM

Quote
siria
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 :-(

Let me the off-topic.

Both.

What I see is that while SourceForge started limiting the connections by rate/time, seems like Archive.org bot understands the HTTP 429 response error (too many connections) as 403 (forbidden).

The error can be verified and can be cast if someone does a check on Archive.org and at that time the bot can't access the site. It would tell that the page hasn't been cached because the access is forbidden and doesn't even offer the button tu save the page (not only the KMM/ZIP/any attachment file). But, then, if someone keeps trying, eventually... the button to save the page would be available.

That, done manually, can be "bypassed" and fix the archiving issue, but tell that to the bot..., that might be programmed the way it is (good or wrong).

I haven't saved the files myself to let you see the behaviour and do it manually.

Alternatively, you can instruct them, manually, to do it by visiting the urls as:
http://web.archive.org/save/[urltosave]
replacing [urltosave] by the url

That you already may know, but for general knowledge smiling smiley


One way or the other, SourceForge decision to limit connections affects enormously to this site, but isn't less true that just only this site, specially on these craziness days (as Black Friday), is being bombed by botnets continuously. Transpose this to the whole SourceForge, might be a nightmare, but the obsession of botnets managers with SF is crazy. Hey, but we haven't seen downtimes for a looong time now.



Edited 1 time(s). Last edit at 11/29/2021 03:10PM by JohnHell.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.