My attempt at solving some of the long-term issues with uBlock Origin

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: Lootyhoof, FranklinDM

User avatar
UCyborg
Lunatic
Lunatic
Posts: 345
Joined: 2019-01-10, 09:37
Location: Slovenia

My attempt at solving some of the long-term issues with uBlock Origin

Unread post by UCyborg » 2024-04-11, 00:32

I've been messing with the uBlock Origin in recent times, last time I posted about it was in the other thread about AstroSkipper's version, where I posted the version that worked on Epyrus at least like on equivalent Thunderbird mail client.

Since then, I took it a bit further and published the result on my GitHub.

https://github.com/UCyborg/uBlock-for-firefox-legacy/releases

Besides bringing the built-in list closer to the upstream version, adding some misc filter lists among selectable filters and misc changes picked up from the old 1.16.6 version and some newer versions, main additions are:
  • working alias system for referencing redirectable resources and scriptlets from filters,
  • all redirectable stub scripts for disabling various JavaScript frameworks for serving ads have been brought in sync with the upstream version of uBlock Origin, this includes the addition of the stub Google's IMA3 library, which some websites integrate in their video players for playing ad segments,
  • all utility scriptlets from the upstream version of uBlock Origin have been brought over, these manipulate web pages in various ways, there's everything in there from the one for setting cookie values (eg. set-cookie) to the one for auto-clicking specific element on a web page, usually used for things like dismissing cookie dialogs, both redirectable resources and scriptlets are described on the Wiki,
  • added an alias for domain= network filter option: from=
  • implemented static network filter option redirect-rule=, at least in its basic form, doesn't support specifying priority.
I've also replaced legacy filter list with my own version, it removes filters that have been confirmed by me to be no longer needed either because of the new scriptlets that have been added or have simply become obsolete and no longer do what they were supposed to do. Blocking stuff on YouTube for instance no longer relies on legacy filter list.

A note about installation, those that have been using the old 1.16.4.30 version maintained by JustOff can normally update to this one, but those that may have AstroSkipper's version installed will have to remove it first as the latter has a different ID, which makes it possible to have two versions installed that will conflict. User settings are preserved either way unless you go and delete the extension's database file. Note that it's been a while since the filter "uBlock filters - Resource Abuse" has been merged with "uBlock filters - Privacy", so the former is no longer among default filter list in my version. Filter updating process will convert it to user-imported filter; it may be removed by the user then.

Full changelog is on the Releases page on GitHub, but commit logs are the most detailed. Overall, this version should be a bit more effective at its job, but the road to the full parity with the upstream version is still long.

As anything on my GitHub, consider it something done by me for me that happens to be visible publicly. It comes without warranty and without promises of any kind.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5549
Joined: 2015-12-09, 15:45

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by moonbat » 2024-04-11, 00:56

Sounds great. One thing I wish we had was proper filtering on the logger window, the current version has a dropdown to let you filter the type of content shown in the log whereas the legacy one requires you to type. Also it's a shame your fixes can't be merged upstream thanks to JustOff being AWOL.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1611
Joined: 2018-10-28, 19:56
Location: Georgia

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by athenian200 » 2024-04-11, 00:58

I really appreciate you working on this. While I am grateful that AstroSkipper's mod exists for people who need an updated uBO, the lack of Epyrus support was one of the main things that annoyed me about it. Additionally, him being unwilling to work with us or interact with us directly wasn't exactly something I was thrilled about either. I was prepared to just resign myself to accepting that AstroSkipper's mod was the best we were going to get as far as a continuation of uBO, but obviously I am thrilled if someone more willing to communicate with this community directly is interested in making something that... well, to be blunt, targets Pale Moon and Epyrus first and doesn't require our users to wade through MSFN threads... especially when MSFN is known to go offline at times...

The other thing I really, REALLY like about your version in particular is that it's on GitHub and we can see what changes you made. That makes auditing the code much easier and gives me some peace-of-mind. I probably looked kind of dumb fumbling around with WinMerge on the other thread trying to guess what was done in the mod... but the truth is I'm not usually that incompetent, I'm just spoiled to version control systems and am not accustomed to manual diffing with changelogs.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
andyprough
Board Warrior
Board Warrior
Posts: 1094
Joined: 2020-05-31, 04:33

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by andyprough » 2024-04-11, 05:53

This works for me. I removed the AstroSkipper version, installed this version, then purged caches and updated the filters. Seems to block everything I'm expecting. Maybe this can eventually make it onto the Pale Moon add-ons page!

User avatar
LuftWafflePilot
Lunatic
Lunatic
Posts: 308
Joined: 2021-02-19, 20:46

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by LuftWafflePilot » 2024-04-11, 07:13

Ha, this is interesting!

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2866
Joined: 2012-08-19, 20:32

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by back2themoon » 2024-04-11, 09:35

Many thanks for your efforts, UCyborg! I will soon try out your version.

I hope that everyone dealing with uBO Legacy (including AstroSkipper and anyone else) could finally join forces at some point so that we could have a single, unified and best possible Legacy version.
moonbat wrote:
2024-04-11, 00:56
Also it's a shame your fixes can't be merged upstream thanks to JustOff being AWOL.
Can't this be fixed by gorhill?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37529
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by Moonchild » 2024-04-11, 10:33

If this turns out to be a proper viable solution that's being long-term maintained for UXP applications, I'll probably officially retire ABL. I haven't really had a way to spend time on it for some of the enhancement requests, it's not as performant with the continued expansion of the CSS spec (it does most of its things through an injected style sheet) and my suggestion for someone else taking up maintenance has gone unanswered for a long time, so it's probably better that I call it enough.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
distantpluto
Fanatic
Fanatic
Posts: 118
Joined: 2015-12-17, 18:28
Location: UK

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by distantpluto » 2024-04-11, 12:00

Cheers UCyborg :thumbup: I've switched to yours. Hopefully this'll make it to the official add-ons. Thanks again.
Pale Moon and Epyrus on Arch Linux.

User avatar
Night Wing
Knows the dark side
Knows the dark side
Posts: 5431
Joined: 2011-10-03, 10:19
Location: Piney Woods of Southeast Texas, USA

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by Night Wing » 2024-04-11, 13:00

moonbat wrote:
2024-04-11, 00:56
Also it's a shame your fixes can't be merged upstream thanks to JustOff being AWOL.
Off-topic:
JustOff is Ukrainian. You might want to give him the benefit of doubt since I haven't been able to see any notice of him on the internet anywhere since dictator Putin of Russia decided to invade Ukraine. If he decided to defend his country by taking up arms against the invading Russians, he might now be dead as a casualty of war.
Linux Mint 22.1 (Xia) Xfce w/Pale Moon, Waterfox, Firefox
MX Linux 23.6 (Libretto) Xfce w/Pale Moon, Waterfox, Firefox
Linux Debian 12.11 (Bookworm) Xfce w/Pale Moon, Waterfox, Firefox

User avatar
Night Wing
Knows the dark side
Knows the dark side
Posts: 5431
Joined: 2011-10-03, 10:19
Location: Piney Woods of Southeast Texas, USA

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by Night Wing » 2024-04-11, 13:07

@ UCyborg

I am still using using JustOff's old 1.16.4.30 version.

I will try your new extension "after" it comes out of beta. I do not do well with beta software if something goes wrong and I am unable to fix the ensuing problem. But thanks for taking a shot at creating a new updated version of uBlock Origin for Pale Moon since I do not care for AstroSkipper's version.
Linux Mint 22.1 (Xia) Xfce w/Pale Moon, Waterfox, Firefox
MX Linux 23.6 (Libretto) Xfce w/Pale Moon, Waterfox, Firefox
Linux Debian 12.11 (Bookworm) Xfce w/Pale Moon, Waterfox, Firefox

Michaell
Lunatic
Lunatic
Posts: 341
Joined: 2018-05-26, 18:13

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by Michaell » 2024-04-11, 16:16

It did install over 30 but I expected it to fail because 6 is an older version number.
Win10home(1709), PM33.7.0-portable as of Apr 8, '25

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2866
Joined: 2012-08-19, 20:32

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by back2themoon » 2024-04-11, 16:18

Michaell wrote:
2024-04-11, 16:16
It did install over 30 but I expected it to fail because 6 is an older version number.
How is 1.16.6 older than 1.16.4.x?

User avatar
frostknight
Astronaut
Astronaut
Posts: 557
Joined: 2022-08-10, 02:25

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by frostknight » 2024-04-11, 20:33

Thank you kindly, I will try your version. :)
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Say NO to Fascism and Corporatism as much as possible!
Also, Peace Be With us All!

User avatar
UCyborg
Lunatic
Lunatic
Posts: 345
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by UCyborg » 2024-04-12, 00:42

I was initially going to just update the stub frameworks for ad serving/analytics and add "redirect-rule=" option, then I figured maybe I should try updating/adding those utility scriptlets that seem to play important role and it looked doable without having to go through many big changes to the upstream version of the extension, although it turned out to be a bit more complicated than it looked like initially.

It seems nobody so far had the idea to go slowly through changes made to the extension since maintenance of XUL version was stopped by gorhill. At least that's how it looks like considering there appears to be a number of missing changes implemented by gorhill ever since the extension was split into separate repository. So it stayed at version 1.16.4 + select changes from newer versions and without looking at the code or testing, one can't really tell whether some feature on the Wiki is really in here or not. Granted, I also took a stab at some of the newer features as they can play vital role, even though I was initially going to go slowly from 1.16.4.

About version control, I agree, it's already difficult to keep track of things with it, let alone without it. I have to say updating this extension is incredibly time consuming. I already have a full-time job in IT, so if anything, I should be spending less time in front of a computer, not more, hence this thread was also meant just as a heads up for those that might be interested in hopefully slightly improved version, no matter how far it will go.

Still, I'd like to try to do couple of more fixes. For instance, current static rule filtering engine doesn't seem to understand asterisk in place of a domain. A lot of non-negligible work has gone into the upstream version while this one has stayed far behind.

BTW, even though I went through the changes number of times and threw away a number of junk commits, one little issue still slipped through...an empty line in one of the scriptlets (json-prune-xhr-response) in the resources.txt file, causing it to not be cached in the entirety due to how that (messy) file works so if it was to be used on any site, it would throw a syntax error in the console...I fixed it in the repo. For users, it should resolve itself on its own in couple of days, but the fastest way to fix it will be to clear caches in uBlock's settings and triggering the update manually.

User avatar
FranklinDM
Add-ons Team
Add-ons Team
Posts: 616
Joined: 2017-01-14, 02:40
Location: Philippines

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by FranklinDM » 2024-04-12, 16:13

I've updated Fresco's listing to point to your fork: https://projectfresco.github.io/addons/ ... ock-origin

The external listing on the Pale Moon add-ons site remains unchanged for now.

User avatar
LAR Grizzly
Lunatic
Lunatic
Posts: 376
Joined: 2017-08-11, 16:49
Location: Upstate Ohio, USA

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by LAR Grizzly » 2024-04-12, 16:33

Two questions:

1. Will this version automatically update when a new version is released?

2. If not, will we be able to manually install a new version overtop the previous version, or will it require an uninstall/install method?
Win7 Pro SP1 64 Bit
Comodo Internet Security
Pale Moon 33.7.1, Firefox 115.23.0esr, Thunderbird 115.18.0esr, and SeaMonkey 2.53.20

User avatar
billmcct
Board Warrior
Board Warrior
Posts: 1042
Joined: 2012-09-04, 15:19
Location: Union City Georgia USA

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by billmcct » 2024-04-12, 18:47

@UCyborg don't know if you've seen this or not but may be relevant.

https://msfn.org/board/topic/183923-ext ... nt=1263189
--------------------------------------------------------------------------------------------------------------
Dell Precision 15 7550
Windows 10 Pro. 22H2
Xeon W-10885M
64 GB DDR4 ECC memory (128 GB max)
500 GB Corsair T500 main M2 SSD
1 TB Intel storage M2 SSD (6 TB max)
Intel onboard GPU 1080p
Quadro RTX 5000 Max-Q GPU 4K

Pale Moon 33.6.x x64 AVX2 build

The difference between the Impossible and the Possible lies in a man's Determination.
Tommy Lasorda

User avatar
LAR Grizzly
Lunatic
Lunatic
Posts: 376
Joined: 2017-08-11, 16:49
Location: Upstate Ohio, USA

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by LAR Grizzly » 2024-04-12, 19:33

billmcct wrote:
2024-04-12, 18:47
@UCyborg don't know if you've seen this or not but may be relevant.

https://msfn.org/board/topic/183923-ext ... nt=1263189
Interesting. Just for kicks, I tested UCyborgs version and got an 83% on the linked test site. I then tested the webextension version in Firefox (I've tried to match the same settings I have in my Pale Moon setup.). The Firefox version returned only 1% protection!
Win7 Pro SP1 64 Bit
Comodo Internet Security
Pale Moon 33.7.1, Firefox 115.23.0esr, Thunderbird 115.18.0esr, and SeaMonkey 2.53.20

User avatar
andyprough
Board Warrior
Board Warrior
Posts: 1094
Joined: 2020-05-31, 04:33

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by andyprough » 2024-04-12, 21:33

LAR Grizzly wrote:
2024-04-12, 19:33
billmcct wrote:
2024-04-12, 18:47
@UCyborg don't know if you've seen this or not but may be relevant.

https://msfn.org/board/topic/183923-ext ... nt=1263189
Interesting. Just for kicks, I tested UCyborgs version and got an 83% on the linked test site. I then tested the webextension version in Firefox (I've tried to match the same settings I have in my Pale Moon setup.). The Firefox version returned only 1% protection!
I just tested UCyborg's version 1.6.6b1 on that same site and got a 100% score with eMatrix also installed. For whatever that's worth.

I tried UCyborg's 1.6.6b1 without eMatrix in a clean profile and got scores ranging from 70 to 83. I tried AstroSkipper's version in a clean profile and got scores between 80 and 81. I'm not sure that "Ad Blocker test" site is really measuring what it says it is measuring. I've heard that a lot of those "are you vulnerable sites" are scams, but I'm not sure.

User avatar
LAR Grizzly
Lunatic
Lunatic
Posts: 376
Joined: 2017-08-11, 16:49
Location: Upstate Ohio, USA

Re: My attempt at solving some of the long-term issues with uBlock Origin

Unread post by LAR Grizzly » 2024-04-12, 22:08

andyprough wrote:
2024-04-12, 21:33
I've heard that a lot of those "are you vulnerable sites" are scams, but I'm not sure.
Yeah, I believe that there must be something askew with the test site, seeing that uBlock in Firefox failed at 1%.
Win7 Pro SP1 64 Bit
Comodo Internet Security
Pale Moon 33.7.1, Firefox 115.23.0esr, Thunderbird 115.18.0esr, and SeaMonkey 2.53.20