40 Home
nobody edited this page 3 days ago

Welcome to the LocalCDN Wiki!

LocalCDN is a web browser extension for your Firefox that emulates CDNs (Content Delivery Networks). It intercepts the network traffic between a website and remote CDNs, finds supported resources locally, and injects them into the environment. All of this happens automatically, so no prior configuration is required.


Note: You can open these triangles:

CDNs



Here are some of the most frequently asked questions:

  1. Supported CDNs and frameworks
  2. Chrome/Chromium Browser
  3. Can I see which frameworks are requested by a website? Can this extension also logging?
  4. Translation
  5. Test the latest changes from the main or develop branch
  6. Rule generator
  7. Broken websites
  8. Requests to include a framework in LocalCDN
  9. Compatibility with other extensions
  10. Dark Mode
  11. Can I check if LocalCDN really works?
  12. LocalCDN is not recommended by Mozilla. Is it safe to use this extension?
  13. LocalCDN and Firefox for Android (Fenix)
  14. I don’t know your name. How can I trust you?
  15. What do you think about Black-Lives-Matter?
  16. Do you have an overview of all donations and expenses?

1. Which CDNs and frameworks are supported exactly? Where can I check this?

LocalCDN is Open Source so you can of course check out the code. You can either download the extension manually here (right click and 'Save as..') or you can check the following sections:

CDNs CDNs (Develop branch)
ajax.googleapis.com
ajax.aspnetcdn.com
ajax.microsoft.com
cdnjs.cloudflare.com
code.jquery.com
cdn.jsdelivr.net
fonts.googleapis.com
yastatic.net
yandex.st
apps.bdimg.com
libs.baidu.com
cdn.staticfile.org
cdn.bootcss.com
mat1.gtimg.com
lib.sinaapp.com
upcdn.b0.upaiyun.com
stackpath.bootstrapcdn.com
maxcdn.bootstrapcdn.com
netdna.bootstrapcdn.com
use.fontawesome.com
ajax.cloudflare.com
akamai-webcdn.kgstatic.net
gitcdn.github.io
sdn.geekzu.org
ajax.proxy.ustclug.org
unpkg.com
pagecdn.io
cdn.css.net
cdnjs.loli.net
ajax.loli.net
fonts.loli.net
lib.baomitu.com
cdn.bootcdn.net
CDNs (click here to open)
Frameworks (main branch) Frameworks (develop branch)
You can find the included frameworks/libraries in
https://codeberg.org/nobody/LocalCDN/src/branch/main/core/resources.js
and
https://codeberg.org/nobody/LocalCDN/src/branch/develop/core/resources.jsFrameworks (click here to open)

2. Can I use this extension in my Chrome Browser?

Yes, it's possible. For publishing you need a Google Account. I don't have one and don't want one 😉 But Emanuel Bennici takes the source code and publish LocalCDN in the Chrome Web Store.

There are some restrictions for Chrome and Chromium based browsers. While both browsers support the WebExtensionsAPI, there are still differences. Chromium unfortunately doesn't support all the cool features of LocalCDN.

Chromium incompatibilities:

3. Can I see which frameworks are requested by a website? Can this extension also logging?

Of course, but logging is disabled by default.

3.1. Enable logging

Enable logging

3.2. Get logging informations

Open "Browser Console" with CTRL + SHIFT + J or the menu

Get logging informations Get logging informations

3.3. Enable "Show Content Messages" and use the filter

Enable "Show Content Messages" and use the filter Enable "Show Content Messages" and use the filter

Open instructions (click here to open)

4. My native language is not fully supported. Some of the content is in English. Can I translate that somewhere?

Yes you can and that would make me and other users very happy. LocalCDN uses the Open Source tool 'Weblate' for this. You can register there and start directly or you can make suggestions (without registration). I will accept them as soon as possible.


5. You recently changed something in the code and I would like to test it. How can I do that?

That would be great.

⚠️ Please use a different user profile (about:profiles) for this, because your previous settings will be deleted when you remove the temporary extension

  1. go to the develop branch and download this repository
  2. unzip downloaded file to any location you want
  3. start Firefox and create a new profile with about:profiles
  4. start the new Firefox profile and open about:debugging
  5. click this Firefox and load temporary add-on...
  6. select manifest.json from the unzipped file

💡 Step-by-step video: temporary-extension-in-firefox.mp4 (localcdn.org)


6. Why do I need this rule generator? I use an adblocker and want to import these rules. How does it work?

Your adblocker must forward the traffic to LocalCDN so that LocalCDN can detect the requests and replace them with local resources.

If you are using an adblocker (uBlock Origin, uMatrix or AdGuard) you can generate some rules in the LocalCDN settings. Please remember that these rules have to be inserted manually into your adblocker.

For uBlock Origin the following also applies: These rules are only relevant in "medium" or "hard" mode. They are not necessary in Easy Mode or default settings. For more information, please visit the uBlock Origin Wiki.

Icon Mode Rules useful uBlock Wiki
Default Default/Easy No https://github.com/gorhill/uBlock/wiki/Blocking-mode#very-easy-mode-details-
Medium Medium Yes https://github.com/gorhill/uBlock/wiki/Blocking-mode:-medium-mode
Hard Hard Yes https://github.com/gorhill/uBlock/wiki/Blocking-mode:-hard-mode

7. A website looks weird or cannot be used. If I deactivate LocalCDN, everything works. What is the problem?

There are different reasons for broken websites. LocalCDN tries to replace as many resources as possible. I think it makes no sense to replace jQuery on a website and then contact a CDN for the other 10 resources. It isn't possible to include all resources in all versions (jQuery has 151 different versions on GitHub), because that would take up too much space. That's why we need to find a compromise. The compromise in LocalCDN is replacing jQuery 3.5.0 with 3.5.1. When a web page breaks because of this, it's usually a backwards compatibility issue with the resources. So I would be happy if I get the chance to fix the problem.

7.1. SOP

If you find error messages like this in the console (Ctrl + Shift + K) it looks like a CSP/SOP issue. The website determines from which sources a resource can be loaded. In this case, a resource cannot be loaded from the addon storage. The SOP (Same Origin Policy) is a security feature. A bugreport to detect this errors already exists, but with the lowest priority (Bugzilla #1419459). The only solution: Disable LocalCDN for this website.

SOP error in browser console

7.2. Crossorigin/integrity attributes in HTML code

Some websites include external frameworks and use crossorigin/integrity attributes. Both of these prevent the replacement by LocalCDN. Enable the HTML filter to remove these attributes and allow LocalCDN to replace the framework.

⚠️ Unfortunately, it sometimes happens that special characters are then displayed incorrectly. In this case you can deactivate the HTML filter and/or LocalCDN, to display the umlauts correctly.

Char errors

7.2.1. Technical details

To understand the problem, it's important to know what character encoding is. The HTML filter reads the HTML source code with TextDecoder and the character set that's either specified in the HTML source code or transmitted by the webserver.

Then it looks for these two attributes and removes them. When everything is done, TextEncoder writes the HTML source back to the tab. That was actually all.

There is a small problem: TextDecoder can read many character sets, but TextEncoder can write UTF-8 only. This will cause errors during the conversion. These conversion errors are caused by the different character sets. The first 128 characters are the same in e.g. ASCII and UTF-8, but after that there are differences that produce these errors.

If a website is written in UTF-8, then there should be no problems with the conversion, because no conversion happens. With the other character sets it depends on which character should be displayed and if these bits mean something different in UTF-8.

7.3. Service Worker

If a website uses a service worker for caching, it can also block the replacement. If you don't need the functions of the service workers (push notifications or offline functionality), you can disable it globally in about:config -> dom.serviceWorkers.enabled = false

💡 I created an online testing program that allows you to test a website for known issues: https://www.localcdn.org/test/check


8. Requests to include a framework in LocalCDN

Someone asked if I can add a specific framework. First of all, LocalCDN emulates CDNs to improve your online privacy and prevent cross-site profiles about you and your habits. When a website hostes these frameworks itself, then this is okay for privacy. You have no privacy advantages if you exchange the frameworks that are stored locally on the web server. The operator knows you anyway, e.g. Youtube, Twitter, Facebook and Discus. They always knows which page you are currently using.

8.1. Google Fonts

Google Fonts wont be integrated, because this is not necessary to display a web page. If the web page includes Google Fonts and you block them by uBlock, the browser will use the default font instead. Apart from the fact that in my opinion it is not necessary, it is technically not possible to include all Google Fonts. The complete package of all Google Fonts is uncompressed 950 MB (compressed 390 MB in size. Just have a look into this folder. Extensions have a limitation of 200 MB. So you have to check all Google Fonts, which is popular and which should be included and which not. I don't want to do that.

8.2. YouTube/Twitter

YouTube doesn't include any external framework and Twitter is using an own CDN (abs.twimg.com). When you're using one of them only “passive”, you can try “Invidious” or “Nitter”, that's an alternative front-end without 3rd party scripts and CDNs. When you use Youtube/Twitter actively, it doesn't matter if the scripts are loaded locally.

8.3. Google Charts

It's not allowed to use Google Charts "offline":

Can I use charts offline? Your users' computers must have access to https://www.gstatic.com/charts/loader.js in order to use the interactive features of Google Charts. This is because the visualization libraries that your page requires are loaded dynamically before you use them. The code for loading the appropriate library is part of the included script, and is called when you invoke the google.charts.load() method. Our terms of service do not allow you to download the google.charts.load or google.visualization code to use offline.

Can I download and host the chart code locally, or on an intranet? Sorry; our terms of service do not allow you to download and save or host the google.charts.load or google.visualization code. However, if you don't need the interactivity of Google Charts, you can screenshot the charts and use them as you wish.

https://developers.google.com/chart/interactive/faq

This are the reasons why LocalCDN isn't supported now and will not be in future:

  • Google Fonts
  • Google Charts
  • Yandex Metrika
  • Google Plus One
  • Twitter
  • Facebook
  • Disqus
  • embedded self-hosted scripts from Youtube, Twitter, ...
8.4. Which frameworks can be added?

Basically all that are freely available and the license terms don't forbid it. The framework must also be useful and necessary for the function of a website.


9. I have installed some other extensions. Can I install LocalCDN? Is it compatible?

Normally yes. At the moment I know only HTTPS Everywhere and NoScript.

In my opinion the extension is no longer necessary due to various browser and server functions, so I haven't used it for a long time. Because I don't deal with it anymore, I can't answer any questions about it.

If you still want to use HTTPS Everywhere, you can find more information on this topic at Decentraleyes.

In short: LocalCDN always tries to establish secure connections when requests are to be allowed through.

  1. Open HTTPS Everywhere while visiting a website.
  2. Disable all rules within the "Stable Rules" section, except the rule next to "localcdn.org".
  3. Finish

Important: This seems to affect all browsers except Firefox and Firefox based

HTTPS Everywhere (click here to open)

NoScript doesn't support importing the CDNs. So you have two options:

  1. allow the connection manually
  2. export and import settings

The second way: You have to export, edit and re-import your NoScript configuration. In your exported file you will find a section "sites" and "trusted". By default, domains/CDNs are already included there:

    ...
    
    "sites": {
      "trusted": [
        "§:addons.mozilla.org",
        "§:afx.ms",
        "§:ajax.aspnetcdn.com",
        "§:ajax.googleapis.com",
        "§:bootstrapcdn.com",
        "§:code.jquery.com",
        ...

You can attach the CDNs there. Duplicate entries are automatically removed during import.

NoScript (click here to open)

10. In the screenshots I see the Dark Mode. How can I activate that?

This should happen automatically. If not, you will find the solution here:

  • Open about:config
  • Search for "ui.systemUsesDarkTheme"
  • If available, change the value to 1. If not, then create the entry (Type = Number) and set it to 1
  • ⚠️ Please note that this cannot work together with the setting privacy.resistFingerprinting = true, see #337

Enable Dark Mode


11. Can I check if LocalCDN really works?

An external framework (e.g. jQuery) will not be listed as a network connection if LocalCDN can replace the framework. You will only find external connections there. LocalCDN redirects to a local file, however.

How can I check if LocalCDN really works?

You can see the redirection through the source code. On the web page just right click and select "View Page Source". In the source code you will find e.g. this:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

If you copy this link, paste it into the address line, you will be redirected to the local file. Please do not just click on the link, because this will redirect you to this:

view-source:https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js

If you open https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js, you will be forwarded to moz-extension://e129e293-bad9-44d2-ab61-9a5cacb106be/resources/jquery/2.2.4/jquery.min.jsm. The extension ID (e1..be) is random.

Example: https://www.localcdn.org/dl/how_can_i_check_if_localcdn_really_works.mp4

Yes you can (click here to open)

I don't know the exact definitions for "Recommended" and how often this will be checked. Definitely not with every update. The badges are also no guarantee that an extension protect your privacy. Do you remember "Web of Trust"? These extension was also recommended by Mozilla for a while. So you can use the badges as a orientation, but it isn't a guarantee.

I wrote Mozilla an e-mail about this a few weeks ago, but they still haven't answered me. Maybe Mozilla is busy at the moment because of less employees, Fenix and the new badges (I already applied for it)

Mozilla has published here some tips about the missing badges. These badges are only available for Firefox. Chromium has no such labels at all.

If you have a question about a certain line of code or a certain section of code, just create a ticket and I will answer the question.


13. Can I use LocalCDN in Firefox for Android (Fenix)?

Yes, because I have already tested it. Unfortunately Mozilla hasn't unlocked all extensions for it. I don't know when this will finally happen. If you are using Firefox Nightly (Mobile), you can create your own collection and include a maximum of 25 extensions. Expanded extension support in Firefox for Android Nightly

Info: The workaround via Collections is supported by

You can also use my collection:

Collection owner: 15698979
Collection name: nobody

Content:

Are you missing an extension? Then open an issue and I'll add this extension. Collections currently limited to 25, but Mozilla wants to expand it to 50.


14. I don't know your name. How can I trust you?

The skepticism is good and should always be the case. There aren't many developers who publish more than their name. A good example are Custom ROMs. Many times I see only a name and maybe a country, but nothing more. As a developer you also want to protect your privacy, because something once published on the internet cannot be removed. If you publish your name nobody will check it. So I can write what I want. If you just need a name to trust me, just call me Marc 😉

Privacy is important for me. Mine but also yours. I like it when you report missing frameworks, bugs or suggestions on Codeberg, because I delete emails automatically after 14 days. If you report something to me via email, I have to add it manually on Codeberg. Why do I do that? If a missing framework was reported by e-mail and I want to visit this website a second time, I don't know which website it is after 14 days. Suggestions and bug reports should also be public. You do not have to write long text.

Instead of publishing my name, I do other things that might be important:

  • no external connections by LocalCDN
  • internal statistics of LocalCDN disabled by default (will not be transmitted anyway)
  • small commits to better understand code changes
  • all commits are signed with GPG
  • The translation platform is Weblate (Open Source) and translations without registration possible
  • Codeberg instead of GitHub, GitLab or other platforms that collect and analyze your data
  • The website (www.localcdn.org) doesn't use cookies, tracking or analysis tools
  • Server logfiles are automatically deleted after 5 days
  • Emails are automatically deleted after 14 days
  • Contact by e-mail with PGP encryption possible

15. What do you think about Black-Lives-Matter?

People who know me know that I'm absolutely against racism. We are all human. Right now we are alone in this huge universe. Every human being deserves to be respected. No matter what skin color, nationality, gender, religion or anything else. Racism is stupid.

The branch name was changed from Master to Main some time ago. I know that the source code of LocalCDN contains discriminating terms like whitelist and blacklist. I will change these terms to "Allowlist" and "Blocklist". Unfortunately this isn't easy because I used the same terms for the extension storage. I could change this in the next version, but if a user skips exactly this update, it could cause problems. So yes, I will change that, but it takes some time. Issue that containing these changes: #138

No matter if before or after this change: I'm against racism.

Of course I also hate all other stupid things that harm or disadvantage another person (war, terror, violence, etc.)

My message to all racists and all who harm or disadvantage people: 🖕


16. Do you have an overview of all donations and expenses?

Yes, you can find this overview here.