Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
AdBlock Locus
Posted by: RJJIII
Date: March 29, 2022 04:14PM

Updated on 7/6/2022:

If you install K-Meleon or create a new profile, you'll get this popup message about a basic adblock (BAcool smiley plugin. And then it may seem like nothing happens. This is because the BAB has no graphical interface to enable it or download blocking rules. JamesD started a macro to provide that interface years back, and I've been working on an update to James' ad-block button. It's evolved into its own thing, so I'm starting a new thread.

AdBlock Locus is a macro to operate the BAB and set up blocking rules. By default, it uses a custom adblock subscription that pairs down and optimizes rules from EasyList. To use it, simply download the K-Meleon macro module (.kmm) from the page below and save it to your "K-Meleon/macros/" folder or "Profiles/your.profile/macros/" folder.

Download AdBlock Locus

Regarding the name:
A locus is a center of activity or attention. It's often used when discussing a locus of control, the idea being that the more a person feels that their locus of control is within them the more confident and generally better they feel. I thought it fit for a tool to give users control of an ad-blocker that gives them control of their browsing.

I've put considerable custom work into this, but let me also give thanks to:
  • Dorian for the BAB and K-Meleon itself.
  • Roytam for updating the BAB.
  • JamesD, rodocop, and Siria for the button macro from the BAB thread.
  • Disrupted and desga for the restart macro.

And lastly the macro contains code to add an option to the Privacy Bar on 75-style themes like K-Meleon's "Default" theme. If you decide to add a custom entry to toolbars.cfg, you can save a copy with the exact name directly to your profile and K-Meleon will use the config from your profile. This will make it easier to update K-Meleon and will preserve the default config. (Thanks to 4td8s for making me realize the original instructions were not helpful.)



Edited 4 time(s). Last edit at 07/06/2022 03:28AM by RJJIII.

Options: ReplyQuote
Re: AdBlock Locus
Posted by: 4td8s
Date: April 02, 2022 10:39PM

thanks for making this, RJJIII

I wonder if AdBlock Locus is a very good replacement for Adblock Prime if it's better
think it's time for me to try out AdBlock Locus and ditch Adblock Prime

btw, it's toolbars.cfg, not toolsbar.cfg that needs to be edited (and need to be re-edited to add the "Adblockplugin_toggle" entry after doing a manual update as that replaces the modded CFG file with the original one found in the 7z file when newer KM Goanna builds come out - I'll have to backup the modded toolbars.cfg file before updating the KM goanna browser)



Edited 1 time(s). Last edit at 04/02/2022 10:42PM by 4td8s.

Options: ReplyQuote
Re: AdBlock Locus
Posted by: RJJIII
Date: April 03, 2022 04:37AM

4td8s, you're welcome. And you're correct. I fixed the typo in the first post. I'll fix it in the macro comment and upload a new version soon.

AdBlock Locus is an interface for the built-in adblocker (BAcool smiley, so you'll get the BAB's strengths like small size and customization. You'll also get the BAB's quirks like reloading to apply changes and no element hiding. I'll add a screenshot to the download page.

ABPrime is nice. I'm working on creating a single .xpi file version of it.

I may write a menu option to create a Privacy Bar entry in future versions to avoid the awkwardness of editing configs and saving copies with each update. First, I need to sort out subscriptions and $document exceptions.

Options: ReplyQuote
Re: AdBlock Locus
Posted by: RJJIII
Date: April 10, 2022 05:55AM

I've just done a pretty substantial update to the AdBlock Locus Core blocklist. If you refresh your rules or delete adblock.txt you will get the update.

The previous list pulled from a very lightweight list called Blockzilla that actually comes semi-bundled with K-Meleon and was mentioned in the BAB thread. Blockzilla used generic blocking rules though, and as a result, does not block all ads including some of the more obnoxious ones (lame fake error message popup stuff). Blockzilla is no longer an active project, but if you prefer the very tiny Blockzilla setup, you can subscribe to or download the final version of the list from this mirror: https://raw.githubusercontent.com/rjjiii/AdBlock-Locus/main/blockzilla.txt

The new version of core uses AdGuard's version of EasyList which they optimized with telemetry. (I feel a profound sense of irony using telemetry to help block telemetry.) I then run it through a regex filter that removes a couple thousand element hiding rules. This results in a list much smaller than the official Easylist that in my testing seems to block most ads and doesn't slow K-Meleon down too much. It's important to keep any blocklist for the BAB small, especially in case it triggers the BAB's duplication bug. I'm still researching why the duplication bug happens, and I should be able to make AdBlock Locus avoid it soon.

Here's a comparison of the lengths of these base lists and the approximate startup time to help show why it's an issue for the BAB (and therefore AdBlock Locus):

  1K Blockzilla				(starts immediately)
 11K New AdBlock Locus Core		(starts in a few seconds)
 60K EasyList
120K EasyList duplicated		(over 10 seconds!)

Also, 4td8s is correct. After looking into it, that's the only way to preserve changes to the Privacy Bar. I'll keep the hooks and the comment in the macro, but may take the recommendation down so I don't accidentally trip up new users.



Edited 1 time(s). Last edit at 04/10/2022 05:55AM by RJJIII.

Options: ReplyQuote
Re: AdBlock Locus / howto skin button + hiding elements
Posted by: siria
Date: April 19, 2022 10:30PM

ADBLOCK "hiding elements":
CSS hiding rules are defined in adblock.css and work since twenty years or so, out-of-box ;-)
If enabled by Priv-Button or in F2 > Page Display / Content Filters
Prob is the syntax age... strongly suspect current mass download rules use a more modern syntax, but am not familiar with it.

Offtopic:
Howto keep customizations of BUTTONS after KM updates:

Use a personal skin, not the default one. Creating it is real easy but -as usual- requires a bit manual action. Details I've posted long ago somewhere...
Short summary: Create in the ordinary Windows File Explorer (whatever it's named now) a new, own folder under K-Meleon/skins/xxx (name as you wish) and COPY either a whole other skin folder content inside, or at least 2 files, toolbars.cfg and skin.cfg (not skin.js)
Then coose your "new" skin in F2 > GUI / skin and restart.

Better place, or if system forbids it:
Create it in profile folder:
Edit > Configuration > Profile Directory
Create there manually a new folder /skins/xxx

Optional: you can also change there all the images you may want to look different from the default skin.
All skin files which are missing in a folder will automatically be loaded from various default places, first looked up in profile, if not found there, in folder skins/default and skins/shared

Special KM-trick for looking up missing files in another skin folder first, for little "variations" of skins:
download old KM1.5.4 (or better Roytams TLS-updated version!) and take a look at its skin folders "Phoenity" and "Phoenity(Large)"
Guess the system is self-explaining. Always highly regretted that younger versions didn't contain such skin-variations anymore, but the system itself still seems to function.

Example:
/skins/myskin
/skins/myskin(gold)
/skins/myskin(beige)
/skins/myskin(blue)
The variation-folders may contain nothing but a pretty toolbar background image "back.bmp" in various colors.
All the rest of files gets loaded from /skins/myskin or /skins/default etc
(Younger default skins may require additionally toolbars.cfg and skin.cfg, but a little test will tell)



Edited 5 time(s). Last edit at 04/19/2022 11:03PM by siria.

Options: ReplyQuote
Re: AdBlock Locus / howto skin button + hiding elements
Posted by: RJJIII
Date: April 24, 2022 05:36AM

Thanks siria!

And you're correct about the syntax. AdBlock.css lets you use any CSS rule. The element-hiding rules in adblock subscriptions use ## to indicate "display:none". Since the adblock syntax is so simple, it may be possible to create an automatic way to convert the element hiding from some popular subscriptions (like EasyList and Fanboy's Annoyances List) to CSS. I haven't looked into it yet to see how complicated it would be to translate the blocking rules to pure CSS. When I look into it, I'll post back here.

The skin info is very useful. The more I've tinkered with skins, I've found that they're powerful but counterintuitive.

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: siria
Date: April 24, 2022 01:46PM

(_howto_ adblock.css import custom rule sheets)

Here's another extremely handy CSS-trick, which I sadly learnt only decades too late:
It's possible to use separate adblock files together!

The @import line allows to use separate files for e.g.
- own custom rules
- mass-service rules
- yet more mass-service-rules... etc.

That actually seems a quite normal css-procedure, but due to learning-by-doing and always in extreme hurry instead of starting at scratch, I discovered it only by accident much later, since no one in the forum ever mentioned it sad smiley
Perhaps you're aware of it long since, but for everyone else too:

HOWTO
at the BEGINNING of adblock.css write for example:

@import url(testimport.css);
or
@import url(file:///D:/K-Meleon_myprofile/STYLES/testimport.css);

That helps greatly if someone uses mass-import rules together with some personal rules, and wants to do regular updates without accidentally overwriting his own chapter.

IMPORTANT for CSS in general:
the first rules have the lowest priority, rules defined afterwards can overrule them.
So the personal rules are preferably placed into adblock.css, and 1 or more mass-rule sheets as separate files.



Edited 1 time(s). Last edit at 04/24/2022 01:52PM by siria.

Options: ReplyQuote
Re: AdBlock Locus
Posted by: RJJIII
Date: April 24, 2022 06:59PM

AdBlock Locus 1.4

Release:
https://github.com/rjjiii/AdBlock-Locus/releases/tag/v1.4

Updates:
  • Workaround for duplication bug.
  • Streamlined the subscription interface.
  • Included AdGuard's optimized EasyList laguage packs.
  • Core and Fallback subs moved from GitHub's raw url to gh-pages url.
  • Improved error handling.


Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: RJJIII
Date: April 24, 2022 07:11PM

Alright, you've got me experimenting.

I'm going to start testing an ad-blocking stylesheet. I've posted a copy of it online here:
https://rjjiii.github.io/K-Meleon/AdBlockLocus/Shutter.css

I'm pulling rules from EasyList:
https://easylist.to/easylist/easylist.txt

So far, I'm converting the rules that use only an id selector (###) or class selector (##.) because the conversion is very straightforward. Rather than just using "display:none" in the declaration block, I copied this overly thorough declaration from the I Don't Care About Cookies CSS: https://gist.github.com/anthonydillon/b77351b8266a777dc5ef8489d5f7df45

The CSS should probably pull from AdGuard's optimized list because the CSS is over 20,000 lines. I'm not sure about converting exceptions (#@#) to rules. I don't see a straightforward way to do it, and many of the exceptions look like actual ads anyway. The snippet filters (#$#) probably can't be converted and I don't see many of them. The extended CSS rules (#?#) should be straightforward to convert because they appear to insert actual CSS. I would need to do more research and then write a small script. I would also need to write a small script to convert rules limited to specific domains, but that feature does exist in KM.
Quote
siria
(_howto_ adblock.css import custom rule sheets)

Here's another extremely handy CSS-trick, which I sadly learnt only decades too late:
It's possible to use separate adblock files together!

The @import line allows to use separate files for e.g.
- own custom rules
- mass-service rules
- yet more mass-service-rules... etc.

That actually seems a quite normal css-procedure, but due to learning-by-doing and always in extreme hurry instead of starting at scratch, I discovered it only by accident much later, since no one in the forum ever mentioned it sad smiley
Perhaps you're aware of it long since, but for everyone else too:

HOWTO
at the BEGINNING of adblock.css write for example:

@import url(testimport.css);
or
@import url(file:///D:/K-Meleon_myprofile/STYLES/testimport.css);

That helps greatly if someone uses mass-import rules together with some personal rules, and wants to do regular updates without accidentally overwriting his own chapter.

IMPORTANT for CSS in general:
the first rules have the lowest priority, rules defined afterwards can overrule them.
So the personal rules are preferably placed into adblock.css, and 1 or more mass-rule sheets as separate files.
This is giving me an idea. You don't happen to know how KM stores imported CSS for the user stylesheet? If you import a .css file straight into your adblock.css, when does KM update it? I would think it loads it once, stores it in the cache, and keeps it until the cache is emptied, but I haven't made any test for that yet. If KM only updates the CSS occasionally, that might be a convenient way to take advantage of element-hiding from ABP subscriptions. However, if KM is constantly downloading the blocklist, I expect GitHub will just ask me to take it down because of bandwidth.

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: siria
Date: April 26, 2022 12:54AM

> However, if KM is constantly downloading the blocklist,
> I expect GitHub will just ask me to take it down because of bandwidth.

Riddling what you might mean, and not familiar with any other adblock methods except in KM1.x....
So don't know what the xpi's might do, but those Addons are additional, not native.

IIRC (very dimly), the old kmm-macros for BAB-adblock may offer some downloading function, but that's all freely defined in the kmm-macro.

Plain KM does nothing of the sort automatically.
Regarding adblock.css, it's completely static, just a local file since ancient times.
Wouldn't be surprised if the default list was never once updated, but if so, then only by updating the whole KM browser (zip)

When I need to add some new custom rules during a session, it's necessary to quickly toggle the adblock-button on/off 2x. Otherwise the new rules will onl be active at next browser start. They are not cached except during sessions.

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: RJJIII
Date: April 26, 2022 02:05AM

Quote
siria
[ . . . ]

Plain KM does nothing of the sort automatically.
Regarding adblock.css, it's completely static, just a local file since ancient times.
Wouldn't be surprised if the default list was never once updated, but if so, then only by updating the whole KM browser (zip)
That's the part I'm talking about. My thought is that a user could (in theory) put something like:
@import url(https://rjjiii.github.io/K-Meleon/AdBlockLocus/Shutter.css);
into their adblock.css. K-Meleon will then automatically download new rules from that address. I need to do some tests though and see how frequently it downloads/updates.
Quote

When I need to add some new custom rules during a session, it's necessary to quickly toggle the adblock-button on/off 2x. Otherwise the new rules will onl be active at next browser start. They are not cached except during sessions.
Do you mean for adblock.css or adblock.dll?

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: anonymous
Date: April 26, 2022 02:46PM

Related information (SF LINK) was provided by Amen, BenoitRen and Palant in 2007.

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: RJJIII
Date: June 04, 2022 04:18AM

Update first:
Here's a new test version. I've moved the restart function and the images for the icon into the macro. I've also commented out the reverse icons because I'd have to write new code to handle them this way. If this works well, I'll likely continue down this path of trying to pack AdBlock Locus into a single .kmm macro. KM's built-in restart command seems to work most of the time but sometimes just closes out the browser.

If you don't already have AdBlock Locus you should be able to just add this macro to your K-Meleon/macros folder or K-Meleon/Profiles/your.profile/macros/ folder.

Try out the test release here:
https://rjjiii.github.io/K-Meleon/AdBlockLocus/v_2_test_release.html



Regarding adblock.css:
I've tried out using EasyList (the main blocking list) rules in adblock.css. Trying to use this many rules slows the browser down and doesn't offer much more than the BAB. The BAB reduces startup time by a couple of seconds but doesn't slow actual browsing down for me like this. I'm thinking now that maybe Dorian intentionally left this feature out since so many K-Meleon users are on older hardware.

If anyone is interested, I could try porting Fanboy's Annoyances List to CSS. That list is almost completely element hiding. I think I could make it a little smaller and it would have a little less overlap with the Core blocking list.



Regarding the privacy bar:
I said before that I wasn't sure how to easily migrate toolbars.cfg. Siria's explanations took a while to sink in, but now I understand and will update the first post soon:

If you use the "Default" theme or another 75-style theme, "toolbars.cfg" will initially be stored in the K-Meleon/browser/defaults/settings/ folder. DO NOT EDIT this file. Copy it and paste it into your profile folder. Now, K-Meleon will use your profile's config and if you ever mess something up, you can just rename/move toolbars.cfg from your profile and the defaults will be restored.

If you use a classic-style theme like Klassic or Phoenity: your toolbars.cfg will be stored in your theme. Again, DO NOT EDIT this file. You would create a variant theme like the way that siria explained above. So if you use Klassic, you'd create a K-Meleon/Profiles/your.profile/skins/Klassic(custom)/ folder, then copy and paste your toolbars.cfg there.



Future updates:
The 2 big things that are issues with this ad-blocking solution are that the BAB must restart EVERY time anything changes and that the BAB doesn't support $document exceptions. In the source code, it looks like Dorian put the $document exception in the Kplugin but it's just not working. Maybe this is something that I can work around or maybe there is an easy fix? The restarting is unfortunately probably not something that I can change. There are some smaller updates that I wanted to get other's opinions on:
  • Does anybody need this to sync to the CSS adblocker?
  • JamesD's macro had a lot of logging features for the macro itself (in addition to adblock logs). Do people use this or was this just for debugging? I either need to update the logging for everything I've added or take it out altogether. I'm not sure which one yet.
  • Does anybody use inverted icons? Right now, I've just commented out the menu option for them. I could add inverse icons back into the macro, but I wonder if it makes more sense to just remove them?
  • This test version packs the whole thing into one macro which I like. It does make using custom images a little more confusing. It also makes the restart option slightly less reliable. Are those tradeoffs worth it?


Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: siria
Date: June 05, 2022 03:01PM

Just a quick thought while flying by a minute...
Good to see someone spending time and efforts on KM again, thanks :-)

The adblock macro, to avoid misunderstandings, I'd rename it to something with "_menu", otherwise people will think this is the extension itself (which is the dll, creating the functions), when in reality the macro only adds a menu for the dll.
What I'm not happy with is "bundling" other extensions with it (restart). That can also create probs with overwriting different versions or when uninstalling.

SKINS:
Regarding skins (themes), defining all own skin configs in the profile folder has pros and cons (no loss after KM-updates, system writing restrictions less interfering, but somehow more complicated, not usable for multiple profiles, and harder to find folder for most users (Edit>Config>Profile Directory).
Just make sure readers are aware this location isn't mandatory.

It's all about personal likes and awareness. An IMO equally good way is to handle own skin changes e.g. in the normal global KM "skins" folder (if system allows writing in that directory, and if one doesn't update KM weekly...). Personally I prefer having an own folder there, alongside the other skins.
And in general, all over KM, it's a good idea to keep backups of modified FILES in the same folder too, just renamed (toolbars_ori.cfg, toolbars_mod_20220605.cfg, etc), to prevent accidental overwrites at updates or huge probs after little typo-accidents etc.
Except the precious single template cfg in the prefs folder, yes as you write, that one should better be kept original in all cases. Otherwise the tiniest typo/edit glitch can very well crash the whole browser at all future startups and most people have not the slightest clue what's wrong and how to get it running again ;-)

(in the other topic you assume skin creators would all prefer the "old" systems, but am afraid the real reason is: just about all KM-skins were created during KM0.x/1.x times... ;-) )

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: RJJIII
Date: June 05, 2022 04:06PM

Quote
siria
Just a quick thought while flying by a minute...
Good to see someone spending time and efforts on KM again, thanks :-)

The adblock macro, to avoid misunderstandings, I'd rename it to something with "_menu", otherwise people will think this is the extension itself (which is the dll, creating the functions), when in reality the macro only adds a menu for the dll.
Thanks for the kinds words. I'll think about this before I update to the next version because, yes, all of the actual blocking is done by the dll. It does make sense for the button to be named AdBlockPlugin_menu or AdBlockPlugin_button but it would be confusing also to end up with 2 macros doing the same thing. I started by updating JamesD's macro and kept his name thinking that it only makes sense to have one of the macro's at a time.

Quote

What I'm not happy with is "bundling" other extensions with it (restart). That can also create probs with overwriting different versions or when uninstalling.
That's pretty valuable feedback because it was something I was on the fence about. In that latest test release, I've removed the old separate restart extension and am using "ID_APP_RESTART" which works on 75&76. I'll probably also drop the "nuke" macro and just link to its thread. After reading an old post by adodupan, I've even realized there's a way to put the images into the .kmm file. I think a single .kmm file like that would be the easiest for users to manage.

Quote

SKINS:
Regarding skins (themes), defining all own skin configs in the profile folder has pros and cons (no loss after KM-updates, system writing restrictions less interfering, but somehow more complicated, not usable for multiple profiles, and harder to find folder for most users (Edit>Config>Profile Directory).
Just make sure readers are aware this location isn't mandatory.

It's all about personal likes and awareness. An IMO equally good way is to handle own skin changes e.g. in the normal global KM "skins" folder (if system allows writing in that directory, and if one doesn't update KM weekly...). Personally I prefer having an own folder there, alongside the other skins.
And in general, all over KM, it's a good idea to keep backups of modified FILES in the same folder too, just renamed (toolbars_ori.cfg, toolbars_mod_20220605.cfg, etc), to prevent accidental overwrites at updates or huge probs after little typo-accidents etc.
Except the precious single template cfg in the prefs folder, yes as you write, that one should better be kept original in all cases. Otherwise the tiniest typo/edit glitch can very well crash the whole browser at all future startups and most people have not the slightest clue what's wrong and how to get it running again ;-)
That's a good point. A challenge I find when describing how to do things in K-Meleon is to find the middle ground between saying "you must do it this ONE exact way" and "you can do literally anything."

Quote

(in the other topic you assume skin creators would all prefer the "old" systems, but am afraid the real reason is: just about all KM-skins were created during KM0.x/1.x times... ;-) )
Lol, maybe. After using both systems to create a skin, I found the new way to be more flexible and easy to customize for an end user. I actually can't use most old-style skins after upgrading my laptop because the resolution is too high; 16-pixel icons are the size of bullet points. The 75-style skins are more complex to actually make though. I did a mostly old-style skin and was suprised to find that I could put each image in its own file and make all of my toolbars different sizes. I'll make a thread about it after I have more time to test but it's here:
https://rjjiii.github.io/K-Meleon/Archetypal/

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: RJJIII
Date: July 03, 2022 08:20AM

I've updated the experimental ad-blocking stylesheet with Adguard's optimized EasyList plus the optimized Annoyance's List. It's 30,000 lines for both combined. I'm using "transform" instead of "display" and that seems a little faster. Display:none works but I believe the issues in speed are in part because using "display" removes the hidden element completely and then the other elements have to be redrawn. Imagine "transform" as a parking lot where if one car leaves, it doesn't affect the other cars, and "display" as a traffic jam where every time a car exits the road all cars behind it must pull forward. To get the best performance on CSS you need to copy and paste the code directly to your adblock.css from shutter.css:

https://rjjiii.github.io/K-Meleon/AdBlockLocus/Shutter.css

To keep things more organized you can also use add an import to adblock.css like this:
@import url("https://rjjiii.github.io/K-Meleon/AdBlockLocus/Shutter.css"winking smiley;

And if you want to convert AdBlock filters to CSS yourself, I'm finding the easiest way is to subscribe to what you want, update your blocking rules, open Elemhide.css in a text editor, and do a find-and-replace using regex like this syntax for Notepad++
Replace:
-moz-binding: url\(about:abp-elemhidehit\?([0-9]+)#dummy\)
With:
transform: scale\(0\)
AdBlock Plus and related extensions like AdBlock Classic, AdBlock, ABPrime, AdBlocker Ultimate, AdBlock Lattitude, and so on use a custom rule for each hidden element to track hits. This is not really feasible with just a stylesheet.

All that said, I don't think there's enough benefit in an adblock stylesheet to warrant incorporating it into AdBlock Locus. I'll leave the CSS file up for anyone interested.

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: JohnHell
Date: July 03, 2022 06:56PM

Quote
RJJIII
I'm using "transform" instead of "display" and that seems a little faster. Display:none works but I believe the issues in speed are in part because using "display" removes the hidden element completely and then the other elements have to be redrawn.

I think that is arguable...

When you use transform you are using some function to apply some kind of vectorization and apply the transformations over that "drawn" element. Kind like a canvas, I would say.

Now, what is more computational intensive, "reorder" the layout or make a transform for every element it applies too?

In the end, all falls on our own PC specs.

In the other hand, I think the most appreciated purpose of "display: none" is to get rid of every "annoying" element on the page and its footprint (white spaces, placeholders, whatever).

Now, if we don't care about the latest, instead use a transform function... why not use "visibility: hidden"? The result is exactly the same, but you don't apply any transformation. It just hides to your eyes.


With all the above, I don't mean I have the answer, as this programming benchmarks are out of my understanding, but has more logic to just hide, than apply a transform. We shouldn't forget that transform CSS function is not only for scaling, but for a few more manipulations. When you ask transform to do something, transform asks, ok, which one should I do now: https://www.w3schools.com/cssref/css3_pr_transform.asp

Nah, this is just my opinion. I personally use "display: none", that, somehow, gives some peace of mind grinning smiley



Edited 1 time(s). Last edit at 07/03/2022 08:03PM by JohnHell.

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: RJJIII
Date: July 06, 2022 03:29AM

Quote
JohnHell
Quote
RJJIII
I'm using "transform" instead of "display" and that seems a little faster. Display:none works but I believe the issues in speed are in part because using "display" removes the hidden element completely and then the other elements have to be redrawn.

I think that is arguable...

When you use transform you are using some function to apply some kind of vectorization and apply the transformations over that "drawn" element. Kind like a canvas, I would say.

Now, what is more computational intensive, "reorder" the layout or make a transform for every element it applies too?

In the end, all falls on our own PC specs.
That's an interesting point. Transform definitely feels quicker on my current laptop but the laptop is also way beyond K-Meleon's system requirements. It is possible that part of the performance boost comes from shifting the workload to the GPU. I couldn't say whether it's slower or faster on old machine with no dedicated graphics hardware.

Quote

In the other hand, I think the most appreciated purpose of "display: none" is to get rid of every "annoying" element on the page and its footprint (white spaces, placeholders, whatever).

Now, if we don't care about the latest, instead use a transform function... why not use "visibility: hidden"? The result is exactly the same, but you don't apply any transformation. It just hides to your eyes.
I think that "visibility: hidden" should work fine too. Maybe with no extra graphics hardware, it would be quicker? I can update the CSS file but won't have old hardware to test on for a while.

All 3 options would do more than hiding though because they each remove the ability to click the hidden object, which could direct you to another page or popup a window or run some script. A lot of modern web ads border on malware and make me almost nostalgic for the days when pages just had those single banners ads on the top line. Something like "opacity" would literally only hide the object from your eyes.

Also, the technique I mention above where I used an AdBlock extension to create the CSS, would work just the same if anybody wants to use "display:none" or "visibility:hidden" instead.
Quote

With all the above, I don't mean I have the answer, as this programming benchmarks are out of my understanding, but has more logic to just hide, than apply a transform. We shouldn't forget that transform CSS function is not only for scaling, but for a few more manipulations. When you ask transform to do something, transform asks, ok, which one should I do now: https://www.w3schools.com/cssref/css3_pr_transform.asp

Nah, this is just my opinion. I personally use "display: none", that, somehow, gives some peace of mind grinning smiley
If it works: it works :cool:

Options: ReplyQuote
Update: AdBlock Locus
Posted by: RJJIII
Date: July 06, 2022 03:33AM

I've updated the first post with AdBlock Locus 2.0. This version is just a single K-Meleon macro module (.kmm) file. You can update AdBlock Locus by placing the new macro file into your "K-Meleon/macros/" folder or "Profiles/your.profile/macros/" folder:

https://github.com/rjjiii/AdBlock-Locus/releases/tag/v2.0

Changes and new features:
* The entire extension including icons is now packed into one .kmm file.
* AdBlock Locus Fallback subscription is now deprecated. The handful of sites I was using this to fix have been merged into Core.
* New icons using Lim Chee Aun's gradients from Phoenity Aura.
* Fixed the "disabled" button macro.
* The "$document" exception seems to work on some systems so I've changed how exceptions work.
* Improved language in log messages and status bar messages.
* When you "refresh" the rules K-Meleon will re-start twice to avoid starting without active blocking rules.
+ Subscription changes will now appear in the macro log.
+ Status bar messages have been updated. Even popup menus have status bar messages now.
+ AdBlock Locus core has been updated to include the fallback rules plus custom allowances for several sites like SourceForge.
+ Option to restore default subscription configuration.

Options: ReplyQuote
Re: Update: AdBlock Locus
Posted by: rodocop
Date: July 06, 2022 10:07PM

Great job! Thank you very much!

Options: ReplyQuote
Re: Update: AdBlock Locus
Posted by: Mala Okeh
Date: July 07, 2022 07:18AM

Thx very much RJJIII

One question how do I install the zip file? Where do i put the txt.files and the assets folders?

Thx a lot

Mala

Options: ReplyQuote
Re: Update: AdBlock Locus
Posted by: RJJIII
Date: July 08, 2022 01:54AM

Quote
Mala Okeh
Thx very much RJJIII

One question how do I install the zip file? Where do i put the txt.files and the assets folders?

Thx a lot

Mala
No problem.

You don't need that stuff. GitHub zips up source code below releases. Just put the .kmm file in your macros folder and restart KM.

The link from the first post has the current version and installation instructions:
https://rjjiii.github.io/K-Meleon/AdBlockLocus/

Options: ReplyQuote
Re: AdBlock Locus / adblock.css
Posted by: RJJIII
Date: July 18, 2022 06:52AM

I (finally) tested the "import" ability. I'm posting my results below. In summary, if adblock.css were to import the element hiding rules from EasyList+Annoyances, K-Meleon would download 1 MB of CSS rules every time you launch the browser. I don't think it's a viable way to sync up to a list of blocking rules. Even if the macro module synced adblock.css and the BAB, it wouldn't have a way to update the element-hiding rules in the CSS file.

Updating directly from adblock.css
Reload the page:                     no change
Reload the page multiple times:      no change
Force reload:                        no change
Force reload multiple times:         no change
Toggle on and off:                   updated to current CSS
Restart K-Meleon with same session:  updated to current CSS
Restart K-Meleon with new session:   updated to current CSS

Updating "import" styles into adblock.css
Toggle on and off:                   updated to current CSS
Restart K-Meleon with same session:  updated to current CSS
Restart K-Meleon with new session:   updated to current CSS


Options: ReplyQuote
AdBlock Locus 2.1
Posted by: RJJIII
Date: November 05, 2022 07:31AM

AdBlock Locus 2.1

Updates:
+ Support for icon packs.
+ Support for translation.
+ More site fixes added to the Core blocking list.

Release:
https://github.com/rjjiii/AdBlock-Locus/releases/tag/v2.1

I've updated the link in the first post with a new version. Save the file to your macros folder to install or update.

Version 2.1 uses translateable macro text and it supports icon packs. It was an improvement to migrate the graphical assets into the module because it creates just a single file. Unfortunately, it takes away the user's ability to tinker with the graphical assets like they could in older macros. Version 2.1 will check the skins/shared/ folder for a "Basic_Adblock.png" file. It will use this for icons if it exists but otherwise use the built-in icons.

If you want to try it out, you can download icons used by previous macros by JamesD and Rodocop on the page below. Just extract the archive and save one of the .png files to your skins/shared/ folder. You should be able to even swap in and out different packs while KM is running.

https://rjjiii.github.io/K-Meleon/AdBlockLocus/icon_pack.zip

Options: ReplyQuote
Re: AdBlock Locus 2.1
Posted by: rodocop
Date: November 10, 2022 12:57AM

Thank you for your efforts! Great job!

Options: ReplyQuote
Re: AdBlock Locus 2.1
Posted by: rodocop
Date: January 29, 2023 12:35AM

Also should mention that used AutoIT script (and compiled exe) for restart is way too old and restarts all the instances of KM open at time, not only the one fired up from.

There is a modern (from KM 75.1) Command ID to restart only one instance (current) of open KMs - ID_APP_RESTART, used in macro by JamesD

May be worth to update the macro with new ID and remove old autoit stuff?

Options: ReplyQuote
Re: AdBlock Locus 2.1
Posted by: WasiFH
Date: February 24, 2023 03:58AM

Quote
RJJIII
AdBlock Locus 2.1

Updates:
+ Support for icon packs.
+ Support for translation.
+ More site fixes added to the Core blocking list.

Release:
https://github.com/rjjiii/AdBlock-Locus/releases/tag/v2.1


How can I download when I couldn't see any download link?

Options: ReplyQuote
Re: AdBlock Locus 2.1
Posted by: RJJIII
Date: February 24, 2023 08:10PM

The download link in the first post is always the most up to date and stable release:

https://rjjiii.github.io/K-Meleon/AdBlockLocus/

Options: ReplyQuote


K-Meleon forum is powered by Phorum.