Check cdnjs' repo for missing frameworks
Although LocalCDN has included many frameworks, it is not complete and many less popular frameworks are probably not included.
In addition, manually checking each website to find out whether a framework/CDN combination is missing and then reporting it to the developer requires much work and time.
To include as many frameworks as possible, I think we can check cdnjs' repo.
That being said, there are nearly 4000 entries in
cdnjs/ajax/libs/, so including all of them may require a lot of storage space.
The intention of LocalCDN is not to integrate and replace all existing frameworks. It's to make a website readable without contacting the CDNs.
So, in order for a framework mapping to be included in LocalCDN...
- Find a website using XXX framework
- Make sure the website calls the framework via CDN (i.e. the website does not host the framework itself)
- Block the framework request (e.g. by using uBlock Origin) to see whether it is really necessary. If the website breaks, looks weird, or some features cannot be used, then it can be reported to the developer.
Yes, exactly. That' s a way to test it. I'm using the developer tools of Firefox. Menu -> Web Developer -> Network. There you can block single requests.
By the way, when testing and reporting framework mappings, is it a good idea to enable the “block requests for missing resources” option?
You can do that. When I test something I use a new Firefox profile and the developer tools of Firefox. At the same time I load the extension in another profile as "Temporary Extension" and activate logging in LocalCDN.
Is that option helpful in cases like #147, when a website requests unnecessary frameworks from CDNs?
This is hard to say in general terms, which is better. I always block all non existing frameworks.
By the way, is cookieconsent eligible for inclusion?
I think so. It is not big and could be important for someone. I create a separate issue (#153)
How does that option work?
Does that option block all requests to CDN domains like cdnjs.cloudflare.com, cdn.jsdelivr.net?
If this domain is listed in mappings.js, then yes.
First the URL split into host and path
host = cdnjs.cloudflare.com
path = ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js
falsewill be processed here
LocalCDN decides here what to do with non-existing frameworks
The final step for non-existent frameworks is here with a redirection from HTTP to HTTPS if necessary.
Extract the version number of origin path
Insert extracted version into the target path
Determine and replace the target version
Deleting a branch is permanent. It CANNOT be undone. Continue?