Merge branch 'develop' into 'master'

Develop

See merge request nobody42/localcdn!7
This commit is contained in:
nobody 2020-03-24 07:49:13 +00:00
commit 3a2a020d6b
31 changed files with 14178 additions and 12 deletions

View File

@ -55,6 +55,16 @@ var files = {
// Ext Core
'resources/ext-core/3.1.0/ext-core.jsm': true,
// Finify bundle
'resources/findify-bundle/6.9.15/bundle.js': true,
'resources/findify-bundle/6.9.15/components.js': true,
'resources/findify-bundle/6.9.15/config.js': true,
'resources/findify-bundle/6.9.15/initializer.js': true,
'resources/findify-bundle/6.9.15/polyfill.js': true,
'resources/findify-bundle/6.9.15/vendors~components~initializer.js': true,
'resources/findify-bundle/6.9.15/vendors~initializer.js': true,
'resources/findify-bundle/6.9.15/vendors~sentry.js': true,
// Font Awesome
'resources/fontawesome/4.7.0/css/font-awesome.min.css': true,
'resources/fontawesome/5.7.2/css/all.css': true,
@ -68,11 +78,14 @@ var files = {
// jQuery UI
'resources/jqueryui/1.11.4/jquery-ui.min.jsm': true,
// lozad.js
'resources/lozad.js/1.14.0/lozad': true,
// Modernizr
'resources/modernizr/2.8.3/modernizr.min.jsm': true,
// Moment.js
'resources/moment.js/2.24.0/moment.min.js': true,
'resources/moment.js/2.24.0/moment.min.jsm': true,
// MooTools
'resources/mootools/1.6.0/mootools-core.min.jsm': true,
@ -80,6 +93,9 @@ var files = {
// Prototype
'resources/prototype/1.7.3.0/prototype.jsm': true,
// page.js
'resources/page.js/1.7.1/page.min.jsm': true,
// Scriptaculous
'resources/scriptaculous/1.9.0/scriptaculous.jsm': true,
@ -89,6 +105,9 @@ var files = {
// Underscore.js
'resources/underscore.js/1.8.3/underscore-min.jsm': true,
// Vue.js
'resources/vue/1.0.28/vue.jsm': true,
// Web Font Loader
'resources/webfont/1.6.28/webfont.jsm': true
},

View File

@ -76,13 +76,16 @@ var mappings = {
'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI,
'modernizr/{version}/modernizr.': resources.modernizr,
'moment.js/{version}/moment.': resources.moment,
'moment.js/{version}/moment.min.': resources.moment,
'mootools/{version}/mootools-core': resources.mootools,
'page.js/{version}/page.min.': resources.pageJs,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
'/twitter-bootstrap/{version}/js/bootstrap.min.': resources.bootstrapJS,
'/twitter-bootstrap/{version}/css/bootstrap.min.': resources.bootstrapCSS,
'underscore.js/{version}/underscore.': resources.underscore,
'underscore.js/{version}/underscore-min.': resources.underscore,
'vue/{version}/vue.min.js': resources.vueJs,
'webfont/{version}/webfont': resources.webfont
}
},
@ -117,12 +120,21 @@ var mappings = {
'ember-source@{version}/dist/ember.min.': resources.ember,
'ember-source@{version}/dist/legacy/ember.': resources.ember,
'ember-source@{version}/dist/legacy/ember.min.': resources.ember,
'@findify/bundle@{version}/dist/bundle.js': resources.findifyBundle,
'@findify/bundle@{version}/dist/components.js': resources.findifyBundle,
'@findify/bundle@{version}/dist/config.js': resources.findifyBundle,
'@findify/bundle@{version}/dist/initializer.js': resources.findifyBundle,
'@findify/bundle@{version}/dist/polyfill.js': resources.findifyBundle,
'@findify/bundle@{version}/dist/vendors~components~initializer.js': resources.findifyBundle,
'@findify/bundle@{version}/dist/vendors~initializer.js': resources.findifyBundle,
'@findify/bundle@{version}/dist/vendors~sentry.js': resources.findifyBundle,
'jquery@{version}/dist/jquery.': resources.jQuery,
'jquery@{version}/dist/jquery.min.': resources.jQuery,
'jquery-ui@{version}/jquery-ui.js': resources.jQueryUI,
'jquery-ui@{version}/jquery-ui.min.js': resources.jQueryUI,
'jquery-ui-dist@{version}/jquery-ui.js': resources.jQueryUI,
'jquery-ui-dist@{version}/jquery-ui.min.js': resources.jQueryUI,
'lozad': resources.lozad,
'npm-modernizr@{version}/modernizr.': resources.modernizr,
'npm-modernizr@{version}/modernizr.min.': resources.modernizr,
'moment@{version}/moment.': resources.moment,
@ -147,6 +159,7 @@ var mappings = {
'jquery.ui/{version}/jquery-ui.js': resources.jQueryUI,
'jquery.ui/{version}/jquery-ui.min.js': resources.jQueryUI,
'momentjs/{version}/moment.': resources.moment,
'momentjs/{version}/moment.min.': resources.moment,
'mootools/{version}/mootools-': resources.mootools,
'swfobject/{version}/swfobject.': resources.swfobject,
'underscorejs/{version}/underscore.': resources.underscore,
@ -167,6 +180,7 @@ var mappings = {
'jquery-ui/{version}/jquery-ui.min.js': resources.jQueryUI,
'modernizr/{version}/modernizr.': resources.modernizr,
'momentjs/{version}/moment.': resources.moment,
'momentjs/{version}/moment.min.': resources.moment,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
@ -187,6 +201,7 @@ var mappings = {
'jquery-ui/{version}/jquery-ui.min.js': resources.jQueryUI,
'modernizr/{version}/modernizr.': resources.modernizr,
'momentjs/{version}/moment.': resources.moment,
'momentjs/{version}/moment.min.': resources.moment,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
@ -207,6 +222,7 @@ var mappings = {
'jqueryui/{version}/jquery-ui.js': resources.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI,
'moment/{version}/moment.': resources.moment,
'moment/{version}/moment.min.': resources.moment,
'mootools/{version}/mootools-yui-compressed.': resources.mootools,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
@ -231,6 +247,7 @@ var mappings = {
'jqueryui/{version}/jquery-ui.js': resources.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI,
'moment/{version}/moment.': resources.moment,
'moment/{version}/moment.min.': resources.moment,
'mootools/{version}/mootools-yui-compressed.': resources.mootools,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
@ -403,6 +420,7 @@ var mappings = {
'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI,
'modernizr/{version}/modernizr.': resources.modernizr,
'moment.js/{version}/moment.': resources.moment,
'moment.js/{version}/moment.min.': resources.moment,
'mootools/{version}/mootools-yui-compressed.': resources.mootools,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,

View File

@ -89,7 +89,7 @@ requestAnalyzer._matchBasePath = function (hostMappings, channelPath) {
requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channelHost, channelPath) {
let resourcePath, versionNumber, resourcePattern;
let resourcePath, versionNumber, resourcePattern, filename, bundle;
resourcePath = channelPath.replace(basePath, '');
@ -122,11 +122,19 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
version = versionNumber && versionNumber[0] || targetPath.match(Resource.VERSION_EXPRESSION);
}
// Get bundle name
bundle = helpers.determineBundle(channelPath);
if(bundle !== '') {
filename = channelPath.split('/').pop();
targetPath = targetPath + filename;
}
// Prepare and return a local target.
return {
'source': channelHost,
'version': version,
'path': targetPath
'path': targetPath,
'bundle': bundle
};
}
}

View File

@ -75,6 +75,11 @@ var resources = {
'path': 'resources/ext-core/{version}/ext-core.jsm',
'type': 'application/javascript'
},
// Finify bundle
'findifyBundle': {
'path': 'resources/findify-bundle/{version}/',
'type': 'application/javascript'
},
// Font Awesome
'fontawesome4': {
'path': 'resources/fontawesome/{version}/css/font-awesome.min.css',
@ -95,6 +100,11 @@ var resources = {
'path': 'resources/jqueryui/{version}/jquery-ui.min.jsm',
'type': 'application/javascript'
},
// lozad.js
'lozad': {
'path': 'resources/lozad.js/{version}/lozad',
'type': 'application/javascript'
},
// Modernizr
'modernizr': {
'path': 'resources/modernizr/{version}/modernizr.min.jsm',
@ -110,6 +120,11 @@ var resources = {
'path': 'resources/mootools/{version}/mootools-core.min.jsm',
'type': 'application/javascript'
},
// page.js
'pageJs': {
'path': 'resources/page.js/{version}/page.min.jsm',
'type': 'application/javascript'
},
// Prototype
'prototypeJS': {
'path': 'resources/prototype/{version}/prototype.jsm',
@ -130,6 +145,11 @@ var resources = {
'path': 'resources/underscore.js/{version}/underscore-min.jsm',
'type': 'application/javascript'
},
// Vue.js
'vueJs': {
'path': 'resources/vue/{version}/vue.jsm',
'type': 'application/javascript'
},
// Web Font Loader
'webfont': {
'path': 'resources/webfont/{version}/webfont.jsm',

View File

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "LocalCDN (fork from Decentraleyes)",
"version": "2.1.6",
"version": "2.1.7",
"browser_specific_settings": {
"gecko": {
"id": "{b86e4813-687a-43e6-ab65-0bde4ab75758}",

View File

@ -218,10 +218,16 @@ helpers.determineResourceName = function (filename) {
return 'jQuery';
case 'jquery-ui.min.jsm':
return 'jQuery UI';
case 'lozad':
return 'lozad.js';
case 'modernizr.min.jsm':
return 'Modernizr';
case 'moment.min.jsm':
return 'Modernizr';
case 'mootools-yui-compressed.jsm':
return 'MooTools';
case 'page.min.jsm':
return 'page.js';
case 'prototype.jsm':
return 'Prototype';
case 'scriptaculous.jsm':
@ -232,6 +238,8 @@ helpers.determineResourceName = function (filename) {
return 'Underscore.js';
case 'webfont.jsm':
return 'Web Font Loader';
case 'vue.jsm':
return 'Vue.js';
case 'bootstrap.min.css':
return 'Bootstrap CSS';
case 'bootstrap.min.js':
@ -243,6 +251,14 @@ helpers.determineResourceName = function (filename) {
}
};
helpers.determineBundle = function (path = '') {
if (path.includes('findify')) {
return 'Findify';
} else {
return '';
}
};
helpers.determineScriptDirection = function (language) {
let rightToLeftLanguages, scriptDirection;
@ -277,9 +293,9 @@ helpers.formatVersion = function (version) {
helpers.setLastVersion = function (type, versionNumber) {
let version, requestVersion;
requestVersion = versionNumber.toString();
if(versionNumber != null && versionNumber != undefined) {
requestVersion = versionNumber.toString();
}
if (type.includes('/angularjs/1.')) {
version = '1.7.9';
} else if (type.includes('/backbone.js/0.')) {
@ -306,6 +322,8 @@ helpers.setLastVersion = function (type, versionNumber) {
version = '3.12.3';
} else if (type.includes('/ext-core/3.')) {
version = '3.1.0';
} else if (type.includes('findify')) {
version = '6.9.15';
} else if (type.includes('/fontawesome/4.')) {
version = '4.7.0';
} else if (type.includes('/fontawesome/5.')) {
@ -318,12 +336,16 @@ helpers.setLastVersion = function (type, versionNumber) {
version = '3.4.1';
} else if (type.includes('/jqueryui/1.')) {
version = '1.11.4';
} else if (type.includes('lozad')) {
version = '1.14.0';
} else if (type.includes('/modernizr/2.')) {
version = '2.8.3';
} else if (type.includes('/moment.js/2.')) {
version = '2.24.0';
} else if (type.includes('/mootools/1.')) {
version = '1.6.0';
} else if (type.includes('/page.js/1.')) {
version = '1.7.1';
} else if (type.includes('/prototype/1.')) {
version = '1.7.3.0';
} else if (type.includes('/scriptaculous/1.')) {
@ -332,6 +354,8 @@ helpers.setLastVersion = function (type, versionNumber) {
version = '2.2';
} else if (type.includes('/underscore.js/1.')) {
version = '1.9.1';
} else if (type.includes('/vue/1.')) {
version = '1.0.28';
} else if (type.includes('/webfont/1.')) {
version = '1.6.28';
}

View File

@ -3,6 +3,7 @@
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @author nobody42
* @since 2016-08-09
* @license MPL 2.0
*
@ -251,11 +252,17 @@ popup._createInjectionGroupElement = function (source, cdn) {
let injectionGroupElement;
// Filter duplicates
let bundle = [];
for (let injection of cdn) {
bundle.push(injection);
}
let filtered = popup._filterDuplicates(bundle, 'bundle');
injectionGroupElement = document.createElement('ul');
injectionGroupElement.setAttribute('class', 'sublist');
for (let injection of cdn) {
for (let injection of filtered) {
let injectionElement = popup._createInjectionElement(injection);
injectionGroupElement.appendChild(injectionElement);
}
@ -271,7 +278,13 @@ popup._createInjectionElement = function (injection) {
injectionElement.setAttribute('class', 'sublist-item');
filename = helpers.extractFilenameFromPath(injection.path);
name = helpers.determineResourceName(filename);
// If bundle empty, use filename
if (injection.bundle === ''){
name = helpers.determineResourceName(filename);
} else {
name = injection.bundle + ' (Bundle)'
}
nameTextNode = document.createTextNode(`- ${name}`);
injectionElement.appendChild(nameTextNode);
@ -350,6 +363,22 @@ popup._onProtectionToggled = function () {
popup._close();
};
popup._filterDuplicates = function(array, key) {
/**
* Function to remove duplicates from an array, depending on 'key'.
* Ignore empty values of the 'key'
*
*/
let filtered = array
.map(e => e[key])
.map((value, index, newArray) => (value != '') ? (newArray.indexOf(value) === index && index) : index )
.filter(e => array[e])
.map(e => array[e]);
return filtered;
};
/**
* Initializations
*/

View File

@ -23,8 +23,11 @@
New in LocalCDN:
</div>
<ul>
<li>URL of testing utility updated</li>
<li>Fixed: <a href="https://gitlab.com/nobody42/localcdn/-/issues/21">"Search on serienjunkies.org not working"</a></li>
<li>Added lozad v1.14.0</li>
<li>Added Findify v6.9.15</li>
<li>Added detection of framework-bundles (e.g. Findify)</li>
<li>Fixed Moment.js (File extension and detection of resource name)</li>
<li>Added Vue.js v1.0.28 and page.js v1.7.1</li>
</ul>
<div class="topic-label">
Please update your uBlock/uMatrix rules
@ -41,6 +44,11 @@
<input id="button-copy-rule-set" type="button" value="Copy">
<hr/>
<h2>History</h2>
<p>2020-03-22 (v2.1.6)</p><br/>
<ul>
<li>URL of testing utility updated</li>
<li>Fixed: <a href="https://gitlab.com/nobody42/localcdn/-/issues/21">"Search on serienjunkies.org not working"</a></li>
</ul>
<p>2020-03-17 (v2.1.5)</p><br/>
<ul>
<li>Simple enable/disable button replaced with toggle switch</li>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window.findifyJsonp=window.findifyJsonp||[]).push([[4],{"T/88":function(e,n,_){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,"development"!==process.env.NODE_ENV&&__CONFIG__,n.default=__CONFIG__}}]);
//# sourceMappingURL=config.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,10 @@
/*! lozad.js - v1.14.0 - 2019-10-19
* https://github.com/ApoorvSaxena/lozad.js
* Copyright (c) 2019 Apoorv Saxena; Licensed MIT */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).lozad=e()}(this,function(){"use strict";
/**
* Detect IE browser
* @const {boolean}
* @private
*/var d="undefined"!=typeof document&&document.documentMode,c={rootMargin:"0px",threshold:0,load:function(t){if("picture"===t.nodeName.toLowerCase()){var e=document.createElement("img");d&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),t.append(e)}if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var r=t.children,a=void 0,o=0;o<=r.length-1;o++)(a=r[o].getAttribute("data-src"))&&(r[o].src=a);t.load()}if(t.getAttribute("data-src")&&(t.src=t.getAttribute("data-src")),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(",").join("'),url('")+"')";else if(t.getAttribute("data-background-image-set")){var i=t.getAttribute("data-background-image-set").split(","),n=i[0].substr(0,i[0].indexOf(" "))||i[0];// Substring before ... 1x
n=-1===n.indexOf("url(")?"url("+n+")":n,1===i.length?t.style.backgroundImage=n:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+n+"; background-image: -webkit-image-set("+i+"); background-image: image-set("+i+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function l(t){t.setAttribute("data-loaded",!0)}var b=function(t){return"true"===t.getAttribute("data-loaded")};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},c,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,s=e.loaded,g=void 0;return"undefined"!=typeof window&&window.IntersectionObserver&&(g=new IntersectionObserver((r=u,a=s,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),b(t.target)||(r(t.target),l(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d})),{observe:function(){for(var t=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)}(o,i),e=0;e<t.length;e++)b(t[e])||(g?g.observe(t[e]):(u(t[e]),l(t[e]),s(t[e])))},triggerLoad:function(t){b(t)||(u(t),l(t),s(t))},observer:g}}});

File diff suppressed because one or more lines are too long

10237
resources/vue/1.0.28/vue.jsm Normal file

File diff suppressed because it is too large Load Diff