diff --git a/_locales/en_US/messages.json b/_locales/en_US/messages.json index 8384905f..06520775 100644 --- a/_locales/en_US/messages.json +++ b/_locales/en_US/messages.json @@ -70,5 +70,13 @@ "generateRuleSetTitle": { "message": "Generate rule sets for uBlock or uMatrix", "description": "Generate rule set title." + }, + "loggingTitle": { + "message": "Enable logging in browser console", + "description": "Enable logging in browser console." + }, + "loggingDescription": { + "message": "Open \"Browser Console\" ( CTRL + SHIFT + J ) to show missing resources", + "description": "Generate rule set title." } } diff --git a/core/constants.js b/core/constants.js index 591b30fd..34ec3154 100644 --- a/core/constants.js +++ b/core/constants.js @@ -64,7 +64,8 @@ const Setting = { 'STRIP_METADATA': 'stripMetadata', 'LAST_MAPPING_UPDATE': 'lastMappingUpdate', 'WHITELISTED_DOMAINS': 'whitelistedDomains', - 'XHR_TEST_DOMAIN': 'xhrTestDomain' + 'XHR_TEST_DOMAIN': 'xhrTestDomain', + 'LOGGING': 'enableLogging' }; const WebRequest = { diff --git a/core/files.js b/core/files.js index 3b9373b5..47aebb9b 100644 --- a/core/files.js +++ b/core/files.js @@ -29,6 +29,9 @@ var files = { 'resources/angularjs/1.7.9/angular-cookies.min.jsm': true, 'resources/angularjs/1.7.9/angular-touch.min.jsm': true, + // Animate CSS + 'resources/animate.css/3.7.2/animate.min.cssm': true, + // Backbone.js 'resources/backbone.js/0.9.10/backbone-min.jsm': true, 'resources/backbone.js/1.4.0/backbone-min.jsm': true, @@ -43,6 +46,13 @@ var files = { // bootstrap-slider 'resources/bootstrap-slider/10.6.2/bootstrap-slider.min.cssm': true, + 'resources/bootstrap-slider/10.6.2/bootstrap-slider.min.jsm': true, + + // clipboard.js + 'resources/clipboard.js/2.0.6/clipboard.min.jsm': true, + + // D3.js + 'resources/d3/3.5.17/d3.min.jsm': true, // Dojo 'resources/dojo/1.14.1/dojo/dojo.jsm': true, @@ -65,6 +75,9 @@ var files = { 'resources/findify-bundle/6.9.15/vendors~initializer.jsm': true, 'resources/findify-bundle/6.9.15/vendors~sentry.jsm': true, + // flv.js + 'resources/flv.js/1.5.0/flv.min.jsm': true, + // Font Awesome 'resources/fontawesome/3.2.1/css/font-awesome.min.cssm': true, 'resources/fontawesome/3.2.1/css/font-awesome.cssm': true, @@ -73,15 +86,33 @@ var files = { 'resources/fontawesome/4.7.0/css/font-awesome.min.cssm': true, 'resources/fontawesome/5.7.2/css/all.cssm': true, + // hls.js + 'resources/hls.js/0.13.2/hls.min.jsm': true, + // jQuery 'resources/jquery/1.8.3/jquery.min.jsm': true, 'resources/jquery/1.12.4/jquery.min.jsm': true, 'resources/jquery/2.2.4/jquery.min.jsm': true, 'resources/jquery/3.4.1/jquery.min.jsm': true, + // jQuery BlockUI + 'resources/jquery.blockUI/2.70/jquery.blockUI.min.jsm': true, + // jQuery UI 'resources/jqueryui/1.11.4/jquery-ui.min.jsm': true, + // jQuery Validation Plugin + 'resources/jquery-validate/1.19.1/jquery.validate.min.jsm': true, + + // jQuery jeditable + 'resources/jquery-jeditable/1.8.0/jquery.jeditable.min.jsm': true, + + // JavaScript Cookie + 'resources/js-cookie/2.2.1/js.cookie.min.jsm': true, + + // lazysizes + 'resources/lazysizes/4.1.8/lazysizes.min.jsm': true, + // lozad.js 'resources/lozad.js/1.14.0/lozad.min.jsm': true, @@ -94,29 +125,62 @@ var files = { // MooTools 'resources/mootools/1.6.0/mootools-core.min.jsm': true, + // P2P Media Loader Core + 'resources/p2p-media-loader-core/0.6.2/p2p-media-loader-core.min.jsm': true, + + // plyr CSS + 'resources/plyr/3.5.10/plyr.min.cssm': true, + // Prototype 'resources/prototype/1.7.3.0/prototype.jsm': true, // page.js 'resources/page.js/1.7.1/page.min.jsm': true, + // rickshaw + 'resources/rickshaw/1.6.6/rickshaw.min.jsm': true, + 'resources/rickshaw/1.6.6/rickshaw.min.cssm': true, + // Cloudflare Rocket Loader 'resources/rocket-loader/latest/rocket-loader.min.jsm': true, // Scriptaculous 'resources/scriptaculous/1.9.0/scriptaculous.jsm': true, + // spin.js + 'resources/spin.js/2.3.2/spin.min.jsm': true, + + // Store.js + 'resources/store.js/2.0.4/store.legacy.min.jsm': true, + // SWFObject 'resources/swfobject/2.2/swfobject.jsm': true, + // toastr.js + 'resources/toastr.js/2.1.4/toastr.min.cssm': true, + 'resources/toastr.js/2.1.4/toastr.min.jsm': true, + + // Twitter Bootstrap + // CSS cannot be loaded with the file extension .cssm (as shown on www.bitchute.com) + // Please do not change it. + 'resources/twitter-bootstrap/3.4.1/js/bootstrap.min.jsm': true, + 'resources/twitter-bootstrap/3.4.1/css/bootstrap.min.css': true, + // Underscore.js 'resources/underscore.js/1.8.3/underscore-min.jsm': true, // Vue.js - 'resources/vue/1.0.28/vue.jsm': true, + 'resources/vue/1.0.28/vue.min.jsm': true, + 'resources/vue/2.6.11/vue.min.jsm': true, // Web Font Loader - 'resources/webfont/1.6.28/webfont.jsm': true + 'resources/webfont/1.6.28/webfont.jsm': true, + + // WebRTC adapter + 'resources/webrtc-adapter/6.4.8/adapter.min.jsm': true, + + // WOW + 'resources/wow/1.1.2/wow.min.jsm': true }, // Files [Staging] diff --git a/core/interceptor.js b/core/interceptor.js index 89d4bd83..3334689e 100644 --- a/core/interceptor.js +++ b/core/interceptor.js @@ -42,13 +42,6 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) { tabDomain = Address.EXAMPLE; } - if (requestDetails.type === WebRequestType.XHR) { - - if (tabDomain !== interceptor.xhrTestDomain) { - return interceptor._handleMissingCandidate(requestDetails.url); - } - } - if (interceptor.taintedDomains[tabDomain] || (/yandex\./).test(tabDomain) || (/wickedlocal\.com/).test(tabDomain)) { @@ -58,11 +51,7 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) { targetDetails = requestAnalyzer.getLocalTarget(requestDetails); targetPath = targetDetails.path; - if (!targetPath) { - return interceptor._handleMissingCandidate(requestDetails.url); - } - - if (!files.active[targetPath]) { + if (!targetDetails) { return interceptor._handleMissingCandidate(requestDetails.url); } @@ -104,11 +93,16 @@ interceptor._handleMissingCandidate = function (requestUrl, preserveUrl) { requestUrlSegments.protocol = Address.HTTPS; requestUrl = requestUrlSegments.toString(); - } + return { + 'redirectUrl': requestUrl + }; - return { - 'redirectUrl': requestUrl - }; + } else { + + return { + 'cancel': false + }; + } }; interceptor._handleStorageChanged = function (changes) { diff --git a/core/main.js b/core/main.js index 68830e1f..441327d2 100644 --- a/core/main.js +++ b/core/main.js @@ -33,7 +33,8 @@ main._initializeSettings = function () { [Setting.ENFORCE_STAGING]: false, [Setting.STRIP_METADATA]: true, [Setting.LAST_MAPPING_UPDATE]: "2020-01-01", - [Setting.WHITELISTED_DOMAINS]: {} + [Setting.WHITELISTED_DOMAINS]: {}, + [Setting.LOGGING]: false }; chrome.storage.local.get(settingDefaults, function (items) { diff --git a/core/mappings.js b/core/mappings.js index ba3df4ec..f2ca4b67 100644 --- a/core/mappings.js +++ b/core/mappings.js @@ -66,32 +66,51 @@ var mappings = { 'cdnjs.cloudflare.com': { '/ajax/libs/': { 'angular.js/{version}/angular.': resources.angular, + 'animate.css/{version}/animate.': resources.animateCSS, 'backbone.js/{version}/backbone.': resources.backbone, 'backbone.js/{version}/backbone-min.': resources.backbone, - 'bootstrap-slider/{version}/css/bootstrap-slider.min.': resources.bootstrapSlider, - 'bootstrap-slider/{version}/bootstrap-slider.min.': resources.bootstrapSlider, + 'bootstrap-slider/{version}/css/bootstrap-slider.min.css': resources.bootstrapSliderCSS, + 'bootstrap-slider/{version}/css/bootstrap-slider.css': resources.bootstrapSliderCSS, + 'bootstrap-slider/{version}/bootstrap-slider.min.js': resources.bootstrapSliderJS, + 'clipboard.js/{version}/clipboard.min.js': resources.clipboardJS, + 'd3/{version}/d3.min.js': resources.d3JS, 'dojo/{version}/dojo.': resources.dojo, 'ember.js/{version}/ember.': resources.ember, 'ext-core/{version}/ext-core.': resources.extCore, 'font-awesome/{version}/css/font-awesome': resources.fontawesome, + 'font-awesome/{version}/css/all.min.css': resources.fontawesome5, + 'jeditable.js/{version}/jquery.jeditable.min.js': resources.jeditableJS, + 'jeditable.js/{version}/jeditable.min.js': resources.jeditableJS, 'jquery/{version}/jquery.': resources.jQuery, 'jquery/{version}/jquery.min.': resources.jQuery, + 'jquery.blockUI/{version}/jquery.blockUI.min.js': resources.jQueryBlockUI, 'jqueryui/{version}/jquery-ui.js': resources.jQueryUI, 'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI, + 'jquery-validate/{version}/jquery.validate.min.js': resources.jqueryValidationPlugin, + 'js-cookie/{version}/js.cookie.min.js': resources.jscookie, + 'lazysizes/{version}/lazysizes.min.js': resources.lazysizes, '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, + 'plyr/{version}/plyr.css': resources.plyrCSS, + 'rickshaw/{version}/rickshaw.min.css': resources.rickshawCSS, + 'rickshaw/{version}/rickshaw.min.js': resources.rickshawJS, 'scriptaculous/{version}/scriptaculous.': resources.scriptaculous, + 'spin.js/{version}/spin.min.js': resources.spinJS, 'swfobject/{version}/swfobject.': resources.swfobject, - '/twitter-bootstrap/{version}/js/bootstrap.min.': resources.bootstrapJS, - '/twitter-bootstrap/{version}/css/bootstrap.min.': resources.bootstrapCSS, + 'toastr.js/{version}/toastr.min.css': resources.toastrCSS, + 'toastr.js/{version}/toastr.min.js': resources.toastrJS, + 'twitter-bootstrap/{version}/js/bootstrap.min.js': resources.twitterBootstrapJS, + 'twitter-bootstrap/{version}/css/bootstrap.': resources.twitterBootstrapCSS, 'underscore.js/{version}/underscore.': resources.underscore, 'underscore.js/{version}/underscore-min.': resources.underscore, 'vue/{version}/vue.min.js': resources.vueJs, 'webfont/{version}/webfont.js': resources.webfont, - 'webfont/{version}/webfontloader.js': resources.webfont + 'webfont/{version}/webfontloader.js': resources.webfont, + 'webrtc-adapter/{version}/adapter.min.js': resources.webRTCadapter, + 'wow/{version}/wow.min.': resources.wow } }, // jQuery CDN (MaxCDN) @@ -117,6 +136,7 @@ var mappings = { '/npm/': { 'angular@{version}/angular.': resources.angular, 'angular@{version}/angular.min.': resources.angular, + 'animate.css@{version}/animate.min.css': resources.animateCSS, 'backbone@{version}/backbone.': resources.backbone, 'backbone@{version}/backbone-min.': resources.backbone, 'backbone@{version}/backbone.min.': resources.backbone, @@ -133,6 +153,8 @@ var mappings = { '@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, + 'flv.js/dist/flv.min.js': resources.flvJS, + 'hls.js/dist/hls.min.js': resources.hlsJS, 'jquery@{version}/dist/jquery.': resources.jQuery, 'jquery@{version}/dist/jquery.min.': resources.jQuery, 'jquery-ui@{version}/jquery-ui.js': resources.jQueryUI, @@ -146,7 +168,9 @@ var mappings = { 'moment@{version}/moment.min.': resources.moment, 'mootools@{version}/lib/mootools-core-{version}-server.': resources.mootools, 'mootools@{version}/lib/mootools-core-{version}-server.min.': resources.mootools, + 'p2p-media-loader-core@latest/build/p2p-media-loader-core.min.js': resources.p2pMediaLoaderCore, 'swfobject@{version}/index.js': resources.swfobject, + 'store-js@{version}/dist/store.legacy.min.js': resources.storeJS, 'scriptaculous-js@{version}/scriptaculous.': resources.scriptaculous, 'underscore@{version}/underscore.': resources.underscore, 'underscore@{version}/underscore-min.': resources.underscore, @@ -387,6 +411,7 @@ var mappings = { 'ext-core/{version}/ext-core.': resources.extCore, 'ext-core/{version}/ext-core-debug.': resources.extCore, 'jquery/{version}/jquery.': resources.jQuery, + 'jquery/{version}/jquery-': resources.jQuery, 'jquery-ui/{version}/jquery-ui.js': resources.jQueryUI, 'jquery-ui/{version}/jquery-ui.min.js': resources.jQueryUI, 'mootools/{version}/mootools.': resources.mootools, @@ -455,7 +480,10 @@ var mappings = { 'netdna.bootstrapcdn.com': { '/bootstrap/': { '{version}/js/bootstrap.min.': resources.bootstrapJS, - '{version}/css/bootstrap.min.': resources.bootstrapCSS + '{version}/css/bootstrap.min.': resources.bootstrapCSS, + }, + '/font-awesome/': { + '{version}/css/font-awesome.css': resources.fontawesome } }, // Font Awesome CDN diff --git a/core/request-analyzer.js b/core/request-analyzer.js index 82553e3b..e33051a7 100644 --- a/core/request-analyzer.js +++ b/core/request-analyzer.js @@ -91,8 +91,11 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel let resourcePath, versionNumber, resourcePattern, filename; - resourcePath = channelPath.replace(basePath, ''); + chrome.storage.local.get(Setting.LOGGING, function (items) { + requestAnalyzer.logging = items.enableLogging; + }); + resourcePath = channelPath.replace(basePath, ''); versionNumber = resourcePath.match(Resource.VERSION_EXPRESSION); resourcePattern = resourcePath.replace(versionNumber, Resource.VERSION_PLACEHOLDER); @@ -106,7 +109,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel targetPath = targetPath.replace(Resource.VERSION_PLACEHOLDER, versionNumber); // Replace the requested version with the latest depending on major version - version = helpers.setLastVersion(targetPath, versionNumber); + version = helpers.setLastVersion(targetPath, versionNumber).toString(); targetPath = targetPath.replace(versionNumber, version); hostShorthands = shorthands[channelHost]; @@ -129,16 +132,21 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel targetPath = targetPath + filename + 'm'; } + if (requestAnalyzer.logging) { + console.log('[ LocalCDN ] Replaced resource: ' + targetPath); + } // Prepare and return a local target. return { 'source': channelHost, - 'version': version.toString(), + 'version': version, 'path': targetPath, 'bundle': bundle }; } } - + if (requestAnalyzer.logging) { + console.warn('[ LocalCDN ] Missing resource: ' + channelHost + channelPath); + } return false; }; diff --git a/core/resources.js b/core/resources.js index 2038a332..7f860499 100644 --- a/core/resources.js +++ b/core/resources.js @@ -40,6 +40,11 @@ var resources = { 'path': 'resources/angularjs/{version}/angular-touch.min.jsm', 'type': 'application/javascript' }, + // Animate CSS + 'animateCSS': { + 'path': 'resources/animate.css/{version}/animate.min.cssm', + 'type': 'text/css' + }, // Backbone.js 'backbone': { 'path': 'resources/backbone.js/{version}/backbone-min.jsm', @@ -56,10 +61,24 @@ var resources = { 'type': 'text/css' }, // bootstrap-slider (Slider for Bootstrap 3) - 'bootstrapSlider': { + 'bootstrapSliderCSS': { 'path': 'resources/bootstrap-slider/{version}/bootstrap-slider.min.cssm', 'type': 'text/css' }, + 'bootstrapSliderJS': { + 'path': 'resources/bootstrap-slider/{version}/bootstrap-slider.min.jsm', + 'type': 'application/javascript' + }, + // clipboard.js + 'clipboardJS': { + 'path': 'resources/clipboard.js/{version}/clipboard.min.jsm', + 'type': 'application/javascript' + }, + // D3.js + 'd3JS': { + 'path': 'resources/d3/{version}/d3.min.jsm', + 'type': 'application/javascript' + }, // Dojo 'dojo': { 'path': 'resources/dojo/{version}/dojo/dojo.jsm', @@ -80,6 +99,12 @@ var resources = { 'path': 'resources/findify-bundle/{version}/', 'type': 'application/javascript' }, + // flv.js + 'flvJS': { + 'path': 'resources/flv.js/{version}/flv.min.jsm', + 'type': 'application/javascript' + }, + // Font Awesome 'fontawesome': { 'path': 'resources/fontawesome/{version}/css/font-awesome.min.cssm', @@ -90,16 +115,46 @@ var resources = { 'path': 'resources/fontawesome/{version}/css/all.cssm', 'type': 'text/css' }, + // hls.js + 'hlsJS': { + 'path': 'resources/hls.js/{version}/hls.min.jsm', + 'type': 'application/javascript' + }, + // jeditableJS + 'jeditableJS': { + 'path': 'resources/jquery-jeditable/{version}/jquery.jeditable.min.jsm', + 'type': 'application/javascript' + }, // jQuery 'jQuery': { 'path': 'resources/jquery/{version}/jquery.min.jsm', 'type': 'application/javascript' }, + // jQuery BlockUI + 'jQueryBlockUI': { + 'path': 'resources/jquery.blockUI/{version}/jquery.blockUI.min.jsm', + 'type': 'application/javascript' + }, // jQuery UI 'jQueryUI': { 'path': 'resources/jqueryui/{version}/jquery-ui.min.jsm', 'type': 'application/javascript' }, + // jQuery Validation Plugin + 'jqueryValidationPlugin': { + 'path': 'resources/jquery-validate/{version}/jquery.validate.min.jsm', + 'type': 'application/javascript' + }, + // js-cookie + 'jscookie': { + 'path': 'resources/js-cookie/{version}/js.cookie.min.jsm', + 'type': 'application/javascript' + }, + // lazysizes + 'lazysizes': { + 'path': 'resources/lazysizes/{version}/lazysizes.min.jsm', + 'type': 'application/javascript' + }, // lozad.js 'lozad': { 'path': 'resources/lozad.js/{version}/lozad.min.jsm', @@ -120,16 +175,35 @@ var resources = { 'path': 'resources/mootools/{version}/mootools-core.min.jsm', 'type': 'application/javascript' }, + // P2P Media Loader Core + 'p2pMediaLoaderCore': { + 'path': 'resources/p2p-media-loader-core/{version}/p2p-media-loader-core.min.jsm', + 'type': 'application/javascript' + }, // page.js 'pageJs': { 'path': 'resources/page.js/{version}/page.min.jsm', 'type': 'application/javascript' }, + // plyr CSS + 'plyrCSS': { + 'path': 'resources/plyr/{version}/plyr.min.cssm', + 'type': 'text/css' + }, // Prototype 'prototypeJS': { 'path': 'resources/prototype/{version}/prototype.jsm', 'type': 'application/javascript' }, + // rickshaw + 'rickshawJS': { + 'path': 'resources/rickshaw/{version}/rickshaw.min.jsm', + 'type': 'application/javascript' + }, + 'rickshawCSS': { + 'path': 'resources/rickshaw/{version}/rickshaw.min.cssm', + 'type': 'text/css' + }, // Cloudflare Rocket Loader 'cfRocketLoader': { 'path': 'resources/rocket-loader/latest/rocket-loader.min.jsm', @@ -140,11 +214,43 @@ var resources = { 'path': 'resources/scriptaculous/{version}/scriptaculous.jsm', 'type': 'application/javascript' }, + // spin.js + 'spinJS': { + 'path': 'resources/spin.js/{version}/spin.min.jsm', + 'type': 'application/javascript' + }, + // Store.js + 'storeJS': { + 'path': 'resources/store.js/{version}/store.legacy.min.jsm', + 'type': 'application/javascript' + }, // SWFObject 'swfobject': { 'path': 'resources/swfobject/{version}/swfobject.jsm', 'type': 'application/javascript' }, + // Twitter Bootstrap JS + 'twitterBootstrapJS': { + 'path': 'resources/twitter-bootstrap/{version}/js/bootstrap.min.jsm', + 'type': 'application/javascript' + }, + // Twitter Bootstrap CSS + // cannot be loaded with the file extension .cssm (as shown on www.bitchute.com) + // Please do not change it. + 'twitterBootstrapCSS': { + 'path': 'resources/twitter-bootstrap/{version}/css/bootstrap.min.css', + 'type': 'text/css' + }, + // toastr.js + 'toastrCSS': { + 'path': 'resources/toastr.js/{version}/toastr.min.cssm', + 'type': 'text/css' + }, + // toastr.js + 'toastrJS': { + 'path': 'resources/toastr.js/{version}/toastr.min.jsm', + 'type': 'application/javascript' + }, // Underscore.js 'underscore': { 'path': 'resources/underscore.js/{version}/underscore-min.jsm', @@ -152,7 +258,7 @@ var resources = { }, // Vue.js 'vueJs': { - 'path': 'resources/vue/{version}/vue.jsm', + 'path': 'resources/vue/{version}/vue.min.jsm', 'type': 'application/javascript' }, // Web Font Loader @@ -163,5 +269,15 @@ var resources = { 'webfontloader': { 'path': 'resources/webfont/{version}/webfontloader.jsm', 'type': 'application/javascript' + }, + // WebRTC adapter + 'webRTCadapter': { + 'path': 'resources/webrtc-adapter/{version}/adapter.min.jsm', + 'type': 'application/javascript' + }, + // WOW + 'wow': { + 'path': 'resources/wow/{version}/wow.min.jsm', + 'type': 'application/javascript' } }; diff --git a/manifest.json b/manifest.json index 9b66256e..dcf281c0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "LocalCDN (fork from Decentraleyes)", - "version": "2.1.8", + "version": "2.1.9", "browser_specific_settings": { "gecko": { "id": "{b86e4813-687a-43e6-ab65-0bde4ab75758}", diff --git a/modules/internal/helpers.js b/modules/internal/helpers.js index 37fd7d36..5da35936 100644 --- a/modules/internal/helpers.js +++ b/modules/internal/helpers.js @@ -26,17 +26,24 @@ var helpers = {}; helpers.insertI18nContentIntoDocument = function (document) { - let scriptDirection, i18nElements; + let scriptDirection, defaultScriptDirection, i18nElements; scriptDirection = helpers.determineScriptDirection(navigator.language); + defaultScriptDirection = helpers.determineScriptDirection('en_US'); i18nElements = document.querySelectorAll('[data-i18n-content]'); i18nElements.forEach(function (i18nElement) { let i18nMessageName = i18nElement.getAttribute('data-i18n-content'); + if(chrome.i18n.getMessage(i18nMessageName) === '') { + // Select english if configured language is empty + i18nElement.innerText = chrome.i18n.getMessage(i18nMessageName); + i18nElement.setAttribute('dir', defaultScriptDirection); + } else { + i18nElement.innerText = chrome.i18n.getMessage(i18nMessageName); + i18nElement.setAttribute('dir', scriptDirection); + } - i18nElement.innerText = chrome.i18n.getMessage(i18nMessageName); - i18nElement.setAttribute('dir', scriptDirection); }); }; @@ -206,28 +213,52 @@ helpers.determineResourceName = function (filename) { return 'AngularJS Sanitize'; case 'angular-touch.min.jsm': return 'AngularJS Touch'; + case 'animate.min.cssm': + return 'Animate CSS' case 'backbone-min.jsm': return 'Backbone.js'; case 'bootstrap.min.cssm': return 'Bootstrap CSS'; + case 'bootstrap.min.css': + return 'Bootstrap CSS'; case 'bootstrap.min.jsm': return 'Bootstrap JS'; + case 'bootstrap-slider.min.jsm': + return 'bootstrap-slider JS'; case 'bootstrap-slider.min.cssm': - return 'bootstrap-slider'; + return 'bootstrap-slider CSS'; + case 'clipboard.min.jsm': + return 'clipboard.js'; + case 'd3.min.jsm': + return 'D3.js'; case 'dojo.jsm': return 'Dojo'; case 'ember.min.jsm': return 'Ember.js'; case 'ext-core.jsm': return 'Ext Core'; + case 'flv.min.jsm': + return 'flv.js'; case 'font-awesome.min.cssm': return 'Font Awesome'; case 'all.cssm': return 'Font Awesome'; + case 'hls.min.jsm': + return 'hls.js'; case 'jquery.min.jsm': return 'jQuery'; case 'jquery-ui.min.jsm': return 'jQuery UI'; + case 'jquery.blockUI.min.jsm': + return 'jQuery Block UI'; + case 'jquery.validate.min.jsm': + return 'jQuery jeditable'; + case 'jquery.jeditable.min.jsm': + return 'jQuery Validation Plugin'; + case 'js.cookie.min.jsm': + return 'JavaScript Cookie'; + case 'lazysizes.min.jsm': + return 'lazysizes'; case 'lozad.min.jsm': return 'lozad.js'; case 'modernizr.min.jsm': @@ -236,22 +267,42 @@ helpers.determineResourceName = function (filename) { return 'Modernizr'; case 'mootools-yui-compressed.jsm': return 'MooTools'; + case 'p2p-media-loader-core.min.jsm': + return 'P2P Media Loader Core'; case 'page.min.jsm': return 'page.js'; + case 'plyr.min.cssm': + return 'plyr CSS'; case 'prototype.jsm': return 'Prototype'; case 'rocket-loader.min.jsm': - return 'Rocket Loader' + return 'Rocket Loader'; + case 'rickshaw.min.jsm': + return 'rickshaw JS'; + case 'rickshaw.min.cssm': + return 'rickshaw CSS'; case 'scriptaculous.jsm': return 'Scriptaculous'; + case 'spin.min.jsm': + return 'spin.js'; + case 'store.legacy.min.jsm': + return 'Store.js'; case 'swfobject.jsm': return 'SWFObject'; + case 'toastr.min.cssm': + return 'toastr.js'; + case 'toastr.min.jsm': + return 'toastr.js'; case 'underscore-min.jsm': return 'Underscore.js'; case 'webfont.jsm': return 'Web Font Loader'; + case 'adapter.min.jsm': + return 'WebRTC adapter'; case 'vue.jsm': return 'Vue.js'; + case 'wow.min.jsm': + return 'WOW'; default: return 'Unknown'; } @@ -296,14 +347,19 @@ helpers.formatVersion = function (version) { } }; -helpers.setLastVersion = function (type, versionNumber) { +helpers.setLastVersion = function (type, version) { - let version, requestVersion; - if(versionNumber != null && versionNumber != undefined) { - requestVersion = versionNumber.toString(); + let requestVersion; + + if(version !== null && version !== undefined) { + requestVersion = version.toString(); + } else if (version === null) { + return 'latest'; } if (type.includes('/angularjs/1.')) { version = '1.7.9'; + } else if (type.includes('/animate.css/3.')) { + version = '3.7.2'; } else if (type.includes('/backbone.js/0.')) { version = '0.9.10'; } else if (type.includes('/backbone.js/1.')) { @@ -318,6 +374,10 @@ helpers.setLastVersion = function (type, versionNumber) { version = '4.4.1'; } else if (type.includes('/bootstrap-slider/10.')) { version = '10.6.2'; + } else if (type.includes('/clipboard.js/2.')) { + version = '2.0.6'; + } else if (type.includes('/d3/3.')) { + version = '3.5.17'; } else if (type.includes('/dojo/1.')) { version = '1.14.1'; } else if (type.includes('/ember.js/1.')) { @@ -330,12 +390,16 @@ helpers.setLastVersion = function (type, versionNumber) { version = '3.1.0'; } else if (type.includes('findify')) { version = '6.9.15'; + } else if (type.includes('/flv.js/')) { + version = '1.5.0'; } else if (type.includes('/fontawesome/3.')) { version = '3.2.1'; } else if (type.includes('/fontawesome/4.')) { version = '4.7.0'; } else if (type.includes('/fontawesome/5.')) { version = '5.7.2'; + } else if (type.includes('/hls.js/')) { + version = '0.13.2'; } else if (type.includes('/jquery/1.')) { version = ( helpers.compareVersion('1.8.3', requestVersion )) ? '1.8.3' : '1.12.4'; } else if (type.includes('/jquery/2.')) { @@ -344,6 +408,16 @@ helpers.setLastVersion = function (type, versionNumber) { version = '3.4.1'; } else if (type.includes('/jqueryui/1.')) { version = '1.11.4'; + } else if (type.includes('/jquery.blockUI/2.')) { + version = '2.70'; + } else if (type.includes('/jquery-validate/1.')) { + version = '1.19.1'; + } else if (type.includes('/jquery-jeditable/1.')) { + version = '1.8.0'; + } else if (type.includes('/js-cookie/2.')) { + version = '2.2.1'; + } else if (type.includes('/lazysizes/4.')) { + version = '4.1.8'; } else if (type.includes('lozad')) { version = '1.14.0'; } else if (type.includes('/modernizr/2.')) { @@ -352,20 +426,40 @@ helpers.setLastVersion = function (type, versionNumber) { version = '2.24.0'; } else if (type.includes('/mootools/1.')) { version = '1.6.0'; + } else if (type.includes('p2p-media-loader-core')) { + version = '0.6.2'; } else if (type.includes('/page.js/1.')) { version = '1.7.1'; + } else if (type.includes('/plyr/3.')) { + version = '3.5.10'; } else if (type.includes('/prototype/1.')) { version = '1.7.3.0'; + } else if (type.includes('/rickshaw/1.')) { + version = '1.6.6'; } else if (type.includes('/scriptaculous/1.')) { version = '1.9.0'; + } else if (type.includes('/spin.js/2.')) { + version = '2.3.2'; + } else if (type.includes('/store.js/2.')) { + version = '2.0.4'; } else if (type.includes('/swfobject/2.')) { version = '2.2'; + } else if (type.includes('/twitter-bootstrap/3.')) { + version = '3.4.1'; + } else if (type.includes('/toastr.js/2.')) { + version = '2.1.4'; } 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('/vue/2.')) { + version = '2.6.11'; } else if (type.includes('webfont')) { version = '1.6.28'; + } else if (type.includes('/webrtc-adapter/6.')) { + version = '6.4.8'; + } else if (type.includes('/wow/1.')) { + version = '1.1.2'; } return version; diff --git a/pages/options/options.html b/pages/options/options.html index 82a41bc0..2a488bf4 100644 --- a/pages/options/options.html +++ b/pages/options/options.html @@ -121,6 +121,23 @@ +
+ +
+ + + +
+ +
+ +
+
diff --git a/pages/options/options.js b/pages/options/options.js index 457627e4..21a18673 100644 --- a/pages/options/options.js +++ b/pages/options/options.js @@ -45,6 +45,7 @@ options._renderOptionsPanel = function () { elements.blockMissing.checked = options._optionValues.blockMissing; elements.disablePrefetch.checked = options._optionValues.disablePrefetch; elements.stripMetadata.checked = options._optionValues.stripMetadata; + elements.enableLogging.checked = options._optionValues.enableLogging; elements.whitelistedDomains.value = domainWhitelist; options._registerOptionChangedEventListeners(elements); @@ -85,6 +86,7 @@ options._registerOptionChangedEventListeners = function (elements) { elements.blockMissing.addEventListener('change', options._onOptionChanged); elements.disablePrefetch.addEventListener('change', options._onOptionChanged); elements.stripMetadata.addEventListener('change', options._onOptionChanged); + elements.enableLogging.addEventListener('change', options._onOptionChanged); elements.whitelistedDomains.addEventListener('keyup', options._onOptionChanged); let type = elements.ruleSets; for(let i = 0; i < type.length; i++) { @@ -132,6 +134,7 @@ options._getOptionElements = function () { [Setting.DISABLE_PREFETCH]: options._getOptionElement(Setting.DISABLE_PREFETCH), [Setting.STRIP_METADATA]: options._getOptionElement(Setting.STRIP_METADATA), [Setting.WHITELISTED_DOMAINS]: options._getOptionElement(Setting.WHITELISTED_DOMAINS), + [Setting.LOGGING]: options._getOptionElement(Setting.LOGGING), ['ruleSets']: document.getElementsByName("rule-sets"), ['copyRuleSet']: document.getElementById("button-copy-rule-set") }; diff --git a/pages/popup/popup.css b/pages/popup/popup.css index a5cd0fe9..c1cc0246 100644 --- a/pages/popup/popup.css +++ b/pages/popup/popup.css @@ -9,8 +9,9 @@ body { font-family: 'Noto Sans', Arial, sans-serif !important; font-size: 75%; margin: 0 auto; - overflow: hidden; - padding: 0; + overflow-y: auto; + overflow-x: hidden; + padding: 0px 15px 0px 15px; max-width: 348px; } diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 554bccc2..e540838c 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -23,8 +23,28 @@ New in LocalCDN:
Please update your uBlock/uMatrix rules @@ -41,6 +61,11 @@

History

+

2020-03-25 (v2.1.7)


+

2020-03-25 (v2.1.7)