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
moonbat
Knows the dark side
Knows the dark side
Posts: 5587
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-07-21, 22:27

LuftWafflePilot wrote:
2024-07-21, 17:39
I thought they were redundant since I use the Easy ones.
The default + Easylist should cover most cases. There's also a few specifically to block newsletter subscription popups that you can find on Filterlists; I find those highly irritating and have thus added them.
"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
Jabber: moonbat@hot-chili.net

User avatar
UCyborg
Lunatic
Lunatic
Posts: 355
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-08-24, 22:45

Got video ads on YouTube today! And syntax error in console. Spent some time in logger and settings page to find the rule that caused it and inside debugger, found that good portion of jsone-prune-xhr-response scriptlet was just missing from the cache. Things started working correctly after using button for purging caches and triggering updating of resources...

Slowly catching up with scriptlet additions/improvements gorhill has made in recent months. I thought about making a release afterwards that would change the "Disable pre-fetching" checkbox to not include disabling DNS pre-fetching as well.

User avatar
andyprough
Board Warrior
Board Warrior
Posts: 1115
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-08-25, 00:29

UCyborg wrote:
2024-08-24, 22:45
Things started working correctly after using button for purging caches and triggering updating of resources...
Purging and updating is something that us uBlock users should be doing with some amount of frequency, it seems.

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-08-26, 17:03

Ha, and I thought I was the only one with the ads (as seen in the other thread)!

Btw why is the purge caches button missing in the Firefox version? The official flavour is so much different?

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-08-26, 17:14

LuftWafflePilot wrote:
2024-08-26, 17:03
Ha, and I thought I was the only one with the ads (as seen in the other thread)!
I never see YT ads. Haven't seen one in years. Below are the YT rules I've added to "My Filters" in UBO. You might want to try them out.

Code: Select all

youtube.com###clarify-box > .ytd-watch-flexy.style-scope
youtube.com###content.yt-bubble-hint-renderer.style-scope
youtube.com###content.yt-tooltip-renderer.style-scope
youtube.com##.opened
youtube.com##.ytd-clarification-renderer.style-scope.container
youtube.com##.ytd-popup-container.style-scope > .ytd-popup-container.style-scope
youtube.com##.ytp-cards-button.ytp-button
youtube.com##.ytp-cards-teaser-text
youtube.com##.ytp-ce-element
youtube.com/yts/jsbin/*/annotations_module.js
Win7 Pro SP1 64 Bit
Comodo Internet Security
Pale Moon 33.7.2, Firefox 115.23.0esr, Thunderbird 115.18.0esr, and SeaMonkey 2.53.20

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2882
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-08-26, 17:34

LuftWafflePilot wrote:
2024-08-26, 17:03
Btw why is the purge caches button missing in the Firefox version? The official flavour is so much different?
They removed it recently. It's not that different. A simple web search will reveal the details. Something about not overburdening the servers with constant updates iirc.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5587
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-08-27, 06:19

LuftWafflePilot wrote:
2024-08-26, 17:03
The official flavour is so much different?
What we have is the legacy version, one-off forked by JustOff originally. Gorhill doesn't bother with the legacy version anymore and JustOff never was interested in backporting features so the current official version is miles ahead. What I miss the most is the filtering capabilities on the logger window - there is nothing like that in what we have here. It's just lucky that an adblocker doesn't really need that many updates to function, it only depends on up to date filter lists.
"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
Jabber: moonbat@hot-chili.net

User avatar
gepus
Board Warrior
Board Warrior
Posts: 1006
Joined: 2017-12-14, 12:59

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

Unread post by gepus » 2024-08-27, 14:35

moonbat wrote:
2024-08-27, 06:19
JustOff never was interested in backporting features so the current official version is miles ahead.
True, but we should be grateful JustOff for what he did nonetheless. It was for many years and generally speaking still is at the moment the best content blocker I'm aware of.
moonbat wrote:
2024-08-27, 06:19
It's just lucky that an adblocker doesn't really need that many updates to function, it only depends on up to date filter lists.
uBO is more than a simple adblocker depending solely on up to date filter lists (granted that the syntax of those lists are operational).

(Maybe it's just me but as an example, I can't find a way to block third-party fonts reliable with uBO legacy. The logger doesn't even see those connections at Kicker.de.)

User avatar
andyprough
Board Warrior
Board Warrior
Posts: 1115
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-08-27, 23:19

gepus wrote:
2024-08-27, 14:35
(Maybe it's just me but as an example, I can't find a way to block third-party fonts reliable with uBO legacy. The logger doesn't even see those connections at Kicker.de.)
The official way to block third party fonts is to uncheck no remote fonts option and add

Code: Select all

*$font,third-party

to My filters. https://github.com/gorhill/uBlock/wiki/ ... mote-fonts

Works a charm.

User avatar
gepus
Board Warrior
Board Warrior
Posts: 1006
Joined: 2017-12-14, 12:59

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

Unread post by gepus » 2024-08-28, 06:31

andyprough wrote:
2024-08-27, 23:19
Works a charm.
I'm afraid it doesn't, at least not reliable.

Site you can test: https://www.kicker.de/
In this particular case uBO legacy won't detect third-party fonts at all and such they are not shown in the logger.

User avatar
satrow
Forum staff
Forum staff
Posts: 1925
Joined: 2011-09-08, 11:27

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

Unread post by satrow » 2024-08-28, 07:40

uBO Legacy detects remote fonts and it can block them - via the dropdown and big A (for alphabet/fonts) = Permanent or temporary rule: "no-remote-fonts: www.kicker.de true"

User avatar
gepus
Board Warrior
Board Warrior
Posts: 1006
Joined: 2017-12-14, 12:59

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

Unread post by gepus » 2024-08-28, 08:25

satrow wrote:
2024-08-28, 07:40
uBO Legacy detects remote fonts and it can block them...
We are talking about third-party fonts.
Blocking first-party fonts makes absolute no sense.

User avatar
satrow
Forum staff
Forum staff
Posts: 1925
Joined: 2011-09-08, 11:27

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

Unread post by satrow » 2024-08-28, 08:33

So remote equals *this* site?

That makes as much sense.

User avatar
gepus
Board Warrior
Board Warrior
Posts: 1006
Joined: 2017-12-14, 12:59

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

Unread post by gepus » 2024-08-28, 08:47

satrow wrote:
2024-08-28, 08:33
So remote equals *this* site?
Remote means the site you visit (first-party).

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5587
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-08-28, 08:48

satrow wrote:
2024-08-28, 08:33
So remote equals *this* site?

That makes as much sense.
I think gepus confused remote to mean the opposite of local, as in locally installed rather than 'remote to the webpage that you are currently on'. It is a little ambiguously worded.
"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
Jabber: moonbat@hot-chili.net

User avatar
UCyborg
Lunatic
Lunatic
Posts: 355
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-08-30, 17:44

The thing with scriptlets being executed partially, I don't see that happening in upstream version, their code is a normal part of extension's code rather than being a separate text resource as in legacy version, which is initially parsed from text file resources.txt, put in memory resident object and cached in a database, where it should be pulled from most of the time on extension load until next update cycle when new resources.txt is pulled from online repository. While I don't see how it could be parsed partially from resources.txt, so does that leave the possibility that it's just partially written to database under some bizarre conditions? I would've checked that scenario when it happened, but I don't know any tool that doesn't get stuck reading huge amount of text in a single field in the SQLite database.

Yes, legacy version is pretty rough around the edges and I'm not good friends with programming, so I won't be the one who will radically re-work it. Even what little I did took me 2 months with little to show for it with a crapload of commits that were junked.

I'm curious about https://www.kicker.de/, even if just look at browser's network tab in dev tools, if I block fonts in uBO, no font entries are logged, with no blocking, it shows few network requests for fonts. What am I missing?

Should've taken a picture, but for the first time, I've seen a popup dialog on YouTube that paused the video and said blocking ads is not allowed, that I might be doing it, that they allow millions of people to watch videos and that I can get YouTube Premium. The popup was a normal part of their UI. There were two buttons below, one said allows ads, the other was for YouTube Premium if I recall correctly and there was a close button (X) on the upper right, which I could use and then could resume playback.

But I wonder, is modern uBO even doing anything about that? We know their code is huge black box, they could be monitoring for specific behavior (or lack of it) to guess user might be blocking requests. Somehow I don't see how modern uBO could prevent that unless someone wrote a rule to specifically defuse part of their code that triggers popup. I remember seeing a rule that did some replacements, but I don't know if it's related to the popup. Of course, Google can change their code any time.

User avatar
gepus
Board Warrior
Board Warrior
Posts: 1006
Joined: 2017-12-14, 12:59

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

Unread post by gepus » 2024-08-30, 19:43

UCyborg wrote:
2024-08-30, 17:44
I'm curious about https://www.kicker.de/, even if just look at browser's network tab in dev tools, if I block fonts in uBO, no font entries are logged, with no blocking, it shows few network requests for fonts. What am I missing?

Code: Select all

*$font,third-party
Two screenshots for better understanding.
- one with uBO/WebExtension/Firefox
- one with uBO/legacy/Pale Moon

As you can see requests for third-party fonts (to Cloudfront) are not detected and such not logged by uBO legacy.
You do not have the required permissions to view the files attached to this post.

User avatar
andyprough
Board Warrior
Board Warrior
Posts: 1115
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-08-31, 04:32

gepus wrote:
2024-08-30, 19:43
Two screenshots for better understanding.
- one with uBO/WebExtension/Firefox
- one with uBO/legacy/Pale Moon

As you can see requests for third-party fonts (to Cloudfront) are not detected and such not logged by uBO legacy.
I ran the same test, checking uBlock's logger for kicker.de on both Pale Moon and Firefox. I got pretty much the same result as you, but I don't think that means that uBlock Legacy was not detecting cloudfront and blocking its fonts. I think that means that kicker.de simply doesn't use the cloudfront cdn when it doesn't detect a Firefox browser. In fact, uBlock on Firefox logs a lot of images, scripts and css coming from the cloudfront cdn as well, whereas uBlock on Pale Moon doesn't log anything coming from cloudfront cdn.

Here's uBlock Legacy blocking some examples of *$third-party,font on the commandmasters.com website:
2024-08-30_23-18.png
You do not have the required permissions to view the files attached to this post.

User avatar
UCyborg
Lunatic
Lunatic
Posts: 355
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-08-31, 05:39

I see what the issue is, legacy uBO doesn't support uncloaking of CNAME records. That site does use Cloudfront regardless of the browser, it's just not obvious.

https://github.com/gorhill/uBlock/wiki/Dashboard:-Settings#uncloak-canonical-names

User avatar
gepus
Board Warrior
Board Warrior
Posts: 1006
Joined: 2017-12-14, 12:59

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

Unread post by gepus » 2024-08-31, 06:34

UCyborg wrote:
2024-08-31, 05:39
I see what the issue is, legacy uBO doesn't support uncloaking of CNAME records.
Bingo :thumbup: