deCDN

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

Moderators: FranklinDM, Lootyhoof

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 803
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: deCDN

Unread post by RealityRipple » 2025-01-02, 17:58

Michaell wrote:
2025-01-02, 15:36
RealityRipple - I may have misunderstood your explanation about "Block CDN access for missing resources". I do not see how that can be site specific. FWIW, I want it to be global, I think, as that's what I'm used to. And worse, the setting is not being saved. I thought maybe it needed at least one domain added to the Block CDNs tab. But there's no obvious way to add any. Even if that worked though, adding specific sites to block is not going to work for me, unless I can configure my content blocking extensions to work around that. So, I'll have to go back to DCE for routine browsing until I can figure out if yours will work the way I want.
I think you've completely misunderstood the interface. The list of CDNs is not an editable list, it's a toggle-able list, generated from the interceptable resources from LocalCDN. If the item in the list is checked, access to the CDN is blocked. Adding sites to the "Ignore Hosts" lists OVERRIDES the global block with specific allows, unless the entry in the CDN list has been manually UN-checked, in which case a site-specific override can also manually add a block to a CDN that's otherwise unblocked.

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

Re: deCDN

Unread post by Michaell » 2025-01-02, 19:40

Yes, I am having a hard time understanding deCDN's operation/settings versus the other two. Right now, I have no need for "Ignore Hosts". Maybe a specific example will help. "ajax.googleapis.com" [first one in the list] is one I would block if it wasn't included in the CDN extension. So I unblock it in ηMatrix with the idea that it will be loaded from the extension's copy. And if not, for some reason, then it would not send the request through to googleapis when I have the option to block missing checked.

Anyway, shouldn't it stay checked - that's expected behavior. And I don't understand the empty Block CDNs tab where nothing can be added and can't be unchecked because there's no list there.
Win10home(1709), PM33.4.1-portable as of Nov 8, '24

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 803
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: deCDN

Unread post by RealityRipple » 2025-01-02, 19:58

Michaell wrote:
2025-01-02, 19:40
Yes, I am having a hard time understanding deCDN's operation/settings versus the other two. Right now, I have no need for "Ignore Hosts". Maybe a specific example will help. "ajax.googleapis.com" [first one in the list] is one I would block if it wasn't included in the CDN extension. So I unblock it in ηMatrix with the idea that it will be loaded from the extension's copy. And if not, for some reason, then it would not send the request through to googleapis when I have the option to block missing checked.

Anyway, shouldn't it stay checked - that's expected behavior. And I don't understand the empty Block CDNs tab where nothing can be added and can't be unchecked because there's no list there.
If your Block CDNs list is empty, you have a more important problem - the resources archive hasn't been downloaded and extracted, so the entire extension is non-functional. This is why extensions that block chrome-level access are a BAD IDEA.

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 803
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: deCDN

Unread post by RealityRipple » 2025-01-02, 20:37

OK, just to organize this, since there seems to be a lot of overlap of people that use this extension that also like to block the inner-workings of things without knowing what they're blocking...

First, keep this very simple thought in mind:
IF YOU BLOCK THINGS, THINGS WILL BREAK. ALWAYS.

Second, this extension contains NO DATA. Everything is a scaffold, a train track, a method of acquiring and passing along the data from LocalCDN. The extension is small and will update rarely because the LocalCDN archive has everything. The archive is about 20 MB compressed, but contains about 70 MB worth of data. LocalCDN's author updates about once a month, and deCDN will NOT re-download this archive until there is a change. If you want to change how often the check is done to reduce how often the download happens, do that through the extension's configuration in about:config - "extensions.decdn.repo.update" defaults to 14, meaning it checks every 2 weeks. The current allowed range is between 7 and 28 (1 to 4 weeks). If need be, I can increase this range to a few months, but the longer you wait, the higher chances websites start to break.

Blocking the check or the download is essentially the same as not having this extension installed.

The CDNs list should always look like this:
list.png
If the list is empty, the archive was not downloaded and extracted, and the extension is doing nothing.

The Resource Archive information should look something like this:
archive.png
archive.png (4.01 KiB) Viewed 1021 times
If the repo commit line is empty, the archive hasn't been downloaded at all.
If the repo commit line is populated, but the CDN List is empty, then the data about the archive was provided, but the archive itself was either blocked, corrupted, or prevented from extracting its files.

To fix the problem, stop blocking the extension from loading what it needs to load (that means both web access to codeberg and file access to your browser's profile directory), then open up about:config, type in "decdn.repo", and reset the "extensions.decdn.repo.commit" and "extensions.decdn.repo.lastCheck" values to force a re-download.
config.png
The re-download will occur if you restart the browser or open a new window (not tab, window).

You can confirm that the archive has been downloaded and extracted yourself. In your browser profile will be a "deCDN" folder:
dir.png
In the folder will be four scripts, a resources folder, and a copy of the mozilla public license.
If these files don't exist, you've blocked something.

The files in that folder are everything to the functionality of this extension. They populate the CDN server list. They provide the script and stylesheet resources. They describe every single relevant URL and domain.

Do not assume, though, that you can just download LocalCDN's archive and extract it to that folder manually. THAT WILL NOT WORK. The extension must do everything itself, unimpeded, uninterrupted, or it will not function. There are lines of code that need to be replaced. There are files that need to be moved. There are preference values that need to be populated. If you interfere with any of these steps, you're breaking the extension. I don't know how more clear I can be.
Last edited by RealityRipple on 2025-01-02, 21:42, edited 1 time in total.

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 803
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: deCDN

Unread post by RealityRipple » 2025-01-02, 21:04

Oh, one more small thing, unrelated:

I'm working on adding support for LocalCDN's "bundle" scripts. I've got TinyMCE working, but MathJax loads fonts through JS, which results in some really annoying breakage.
Basically, if I try to load a font by redirecting to a data: URI, I get an NS_ERROR_DOM_BAD_URI failure. I bypassed this in FontAwesome and Google Material Icons by embedding the data URI directly in the relevant stylesheets. MathJax doesn't have any stylesheets though; it's entirely JS-constructed. There's nowhere for me to replace the expected URL with a data: URI, so it always uses the redirectTo method, which always fails (despite the script that's loading the font being a data: URI as well).
I'm not sure, but I think it's a Catch-22 built into UXP; the file was expected from a normal URL, but redirected to a data: URI; the file loads a font, which it expects from the same origin, it just doesn't understand the script/stylesheet origin was changed internally, but it does know that the font file's origin was changed internally, and since they don't match, the browser blocks it.

Basically, this means that I'm going to have to treat MathJax like a missing resource rather than intercepting it. If anyone wants to try to help narrow down the issue or has any alternate ideas, let me know.

User avatar
andyprough
Keeps coming back
Keeps coming back
Posts: 965
Joined: 2020-05-31, 04:33

Re: deCDN

Unread post by andyprough » 2025-01-02, 21:21

RealityRipple wrote:
2025-01-02, 20:37
OK, just to organize this, since there seems to be a lot of overlap of people that use this extension that also like to block the inner-workings of things without knowing what they're blocking...
All your pictures and descriptions look accurate for mine. Thanks for this writeup.

User avatar
ron_1
Moon Magic practitioner
Moon Magic practitioner
Posts: 2972
Joined: 2012-06-28, 01:20

Re: deCDN

Unread post by ron_1 » 2025-01-02, 21:31

Is it normal that the Block CDNs tab doesn't show when "Block CDN access for Missing Resources (advanced)" is not checked? When it is not checked, deCDN is still working I assume?

(Sorry if this is a dumb question.)

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 803
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: deCDN

Unread post by RealityRipple » 2025-01-02, 21:39

ron_1 wrote:
2025-01-02, 21:31
Is it normal that the Block CDNs tab doesn't show when "Block CDN access for Missing Resources (advanced)" is not checked? When it is not checked, deCDN is still working I assume?

(Sorry if this is a dumb question.)
Ah, no, not dumb at all. This is slightly more complex: You need to check the checkbox temporarily to see the list. If you check the checkbox and the tab appears and the list is populated, yes, it's working. HOWEVER, if you check the checkbox to take a look at that tab, but the list is empty, then no, it's not working correctly. You can hit cancel or uncheck the checkbox afterwards to disable the feature, it's just a quick and easy indicator of the fact that the CDN data from LocalCDN has been correctly read.

User avatar
ron_1
Moon Magic practitioner
Moon Magic practitioner
Posts: 2972
Joined: 2012-06-28, 01:20

Re: deCDN

Unread post by ron_1 » 2025-01-02, 21:40

Thank you. It's populated, so all is well. And thanks again for this add-on.

User avatar
frostknight
Lunatic
Lunatic
Posts: 423
Joined: 2022-08-10, 02:25

Re: deCDN

Unread post by frostknight » 2025-01-03, 05:22

Michaell wrote:
2025-01-02, 15:36
The issue isn't memory or CPU [although I do care about those]. It's about monthly data limit, which I'm not going to debate here.
Oh, you must be tethering or using something unusual. Well then, my bad. I was unaware.
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
RealityRipple
Keeps coming back
Keeps coming back
Posts: 803
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: deCDN

Unread post by RealityRipple » 2025-01-03, 22:16

I considered this before, but on the subject of the LocalCDN data - should I add an "erase/reset" button in the options window to delete and force a re-download? Or is the manual "reset in about:config" method sufficient?

User avatar
sinfulosd
Hobby Astronomer
Hobby Astronomer
Posts: 19
Joined: 2022-07-13, 03:01

Re: deCDN

Unread post by sinfulosd » 2025-01-03, 22:25

RealityRipple wrote:
2025-01-03, 22:16
I considered this before, but on the subject of the LocalCDN data - should I add an "erase/reset" button in the options window to delete and force a re-download? Or is the manual "reset in about:config" method sufficient?
Me personally, I support the idea of a button in the options window. Not everyone can be a tech-savvy and navigate through the About:config menu. (Which is why I supported the idea of "Preload page content" as a checkmark, despite having the option for it in the about:config)

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 803
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: deCDN

Unread post by RealityRipple » 2025-01-05, 00:05

Released the first update today: a few new blockable things, a few bug fixes, and the Erase/Reset button in the Options window.

Additionally, if you're interested in trying a test version that blocks Google Fonts and adds Bundle support (TinyMCE, DataTables, ScrollMagic, and Pure CSS), there's a branch on the repository called "bundles-n-fonts". The ability to pack the repo into an XPI file is the technical threshold required to use the unstable code ;)

User avatar
andyprough
Keeps coming back
Keeps coming back
Posts: 965
Joined: 2020-05-31, 04:33

Re: deCDN

Unread post by andyprough » 2025-01-05, 05:58

RealityRipple wrote:
2025-01-05, 00:05
if you're interested in trying a test version that blocks Google Fonts and adds Bundle support (TinyMCE, DataTables, ScrollMagic, and Pure CSS), there's a branch on the repository called "bundles-n-fonts". The ability to pack the repo into an XPI file is the technical threshold required to use the unstable code ;)
That blocking of Google Fonts is a nice touch. Should we have this test version on the 'main', 'develop', or 'experimental' repo branch, or does it matter?

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 803
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: deCDN

Unread post by RealityRipple » 2025-01-05, 08:23

andyprough wrote:
2025-01-05, 05:58
RealityRipple wrote:
2025-01-05, 00:05
if you're interested in trying a test version that blocks Google Fonts and adds Bundle support (TinyMCE, DataTables, ScrollMagic, and Pure CSS), there's a branch on the repository called "bundles-n-fonts". The ability to pack the repo into an XPI file is the technical threshold required to use the unstable code ;)
That blocking of Google Fonts is a nice touch. Should we have this test version on the 'main', 'develop', or 'experimental' repo branch, or does it matter?
That's the LocalCDN branches; unrelated to this. You can see the differences through the link to the commit.

User avatar
Basilisk-Dev
Lunatic
Lunatic
Posts: 452
Joined: 2022-03-23, 16:41
Location: Chamber of Secrets
Contact:

Re: deCDN

Unread post by Basilisk-Dev » 2025-01-06, 17:59

Thanks for the add-on. It works perfectly in Basilisk after modifying install.rdf.
Basilisk Project Owner

viewtopic.php?f=61&p=230756

thosrtanner
Lunatic
Lunatic
Posts: 426
Joined: 2014-05-10, 18:19
Location: UK

Re: deCDN

Unread post by thosrtanner » 2025-01-12, 18:13

Hi. I thought this looked useful so I downloaded it. And something very odd happens. With this extension in enabled, after a period of time (5 minutes to a couple of hours), palemoon crashes. The browser window disappears, and I have to start it palemoon again. Unfortunately, because palemoon crashes, I don't have anything in the console log I can provide to help, unless there's another log somewhere?

I'm running latest palemoon on windows 11

If there's anything further I can provide to help you work out what is going on, I'd be happy to help.

Cheers

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

Re: deCDN

Unread post by back2themoon » 2025-01-12, 18:41

thosrtanner wrote:
2025-01-12, 18:13
If there's anything further I can provide to help you work out what is going on, I'd be happy to help.
Information to include when asking for support

thosrtanner
Lunatic
Lunatic
Posts: 426
Joined: 2014-05-10, 18:19
Location: UK

Re: deCDN

Unread post by thosrtanner » 2025-01-12, 20:03

yeah, this query was directed more to the author of the extension as using it causes palemoon to crash (for me at least), so he might have more idea of what is going on or if there are any clashing extensions he might know about. This isn't, as yet, a general palemoon request. And even if it was, I still think if there was a way of getting some sort of information when palemoon crashed would be quite useful.

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

Re: deCDN

Unread post by Moonchild » 2025-01-12, 20:34

The linked post does include ways to get more information about AppCrashes.
If you can reliably reproduce the crash, even better would be to attach a debugger before running the browser, then reproducing the crash so it can capture the actual call stack, as well and/or generate a crashdump.
"The world will not be destroyed by those who do evil, but by those who watch them without doing anything." - Albert Einstein
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Post Reply