1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2024-12-23 00:25:15 +01:00
This commit is contained in:
nobody42 2020-04-05 08:55:04 +02:00
parent f05a62266e
commit a8397ffa6b
No known key found for this signature in database
GPG Key ID: AB5145CF05BFE119
4 changed files with 53 additions and 1 deletions

View File

@ -99,6 +99,26 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
versionNumber = resourcePath.match(Resource.VERSION_EXPRESSION);
resourcePattern = resourcePath.replace(versionNumber, Resource.VERSION_PLACEHOLDER);
/*
NOTE:
jsDelivr allows to load several files in one request
This is just a workaround. If there are more websites which use this, we will have to do crazy things here to find and redirect these files.
It's not possible to respond to a request with multiple redirections
https://gitlab.com/nobody42/localcdn/-/issues/45
*/
let regexJsDelivr = RegExp(/\/combine.*jquery.*hogan.*algoliasearch.*autocomplete.*/);
if (channelHost.includes('cdn.jsdelivr.net') && regexJsDelivr.test(channelPath)) {
return {
'source': channelHost,
'version': 'beta',
'path': 'resources/jsdelivr-combine-jquery-hogan-algoliasearch-autocomplete.jsm',
'bundle': ''
};
}
for (let resourceMold of Object.keys(resourceMappings)) {
if (resourcePattern.startsWith(resourceMold)) {

View File

@ -292,7 +292,8 @@ popup._createInjectionElement = function (injection) {
if (injection.version !== null) {
noteElement = document.createElement('span');
noteElement.setAttribute('class', 'side-note');
noteTextNode = document.createTextNode(` v${injection.version}`);
let versionNode = (injection.version === 'beta') ? ` ${injection.version}` : ` v${injection.version}`;
noteTextNode = document.createTextNode(versionNode);
noteElement.appendChild(noteTextNode);
injectionElement.appendChild(noteElement);
}

View File

@ -27,6 +27,7 @@
<li>Fixed <a href="https://gitlab.com/nobody42/localcdn/-/issues/26">"#26"</a> (bitchute.com)</li>
<li>Added: Select2 v4.0.12 (<a href="https://gitlab.com/nobody42/localcdn/-/issues/44">"Fixed #44"</a>)</li>
<li>Added: jQuery Migrate v3.1.0 and v1.4.1 (<a href="https://gitlab.com/nobody42/localcdn/-/issues/42">"Fixed #42"</a>)</li>
<li>Fixed: jsDelivr combined file (jQuery v2.2.4, Hogan.js v3.0.2, AlgoliaSearch v3.30.0 and Autocomplete.js v0.31.0) <a href="https://gitlab.com/nobody42/localcdn/-/issues/45">"Issue#45"</a> <strong>(Just a workaround!)</strong></li>
</ul>
<div class="topic-label">
Please update your uBlock/uMatrix rules

File diff suppressed because one or more lines are too long