diff --git a/core/files.js b/core/files.js index 83f3878c..369b57ea 100644 --- a/core/files.js +++ b/core/files.js @@ -96,6 +96,9 @@ var files = { // page.js 'resources/page.js/1.7.1/page.min.jsm': true, + // Cloudflare Rocket Loader + 'resources/rocket-loader/latest/rocket-loader.min.jsm': true, + // Scriptaculous 'resources/scriptaculous/1.9.0/scriptaculous.jsm': true, diff --git a/core/mappings.js b/core/mappings.js index 8774755d..ae61f5e5 100644 --- a/core/mappings.js +++ b/core/mappings.js @@ -445,9 +445,10 @@ var mappings = { }, // MaxCDN Bootstrap 'maxcdn.bootstrapcdn.com': { - '/bootstrap/': { - '{version}/js/bootstrap.min.': resources.bootstrapJS, - '{version}/css/bootstrap.min.': resources.bootstrapCSS + '/': { + 'bootstrap/{version}/js/bootstrap.min.': resources.bootstrapJS, + 'bootstrap/{version}/css/bootstrap.min.': resources.bootstrapCSS, + 'font-awesome/{version}/css/font-awesome.min.': resources.fontawesome4 } }, // NetDNA Bootstrap @@ -462,8 +463,13 @@ var mappings = { '/releases/v': { '{version}/css/all.css': resources.fontawesome5 } + }, + // Cloudflare Rocket-Loader + 'ajax.cloudflare.com': { + '/': { + 'cdn-cgi/scripts/7089c43e/cloudflare-static/rocket-loader.min.': resources.cfRocketLoader + } } - }; // Geekzu Public Service [Mirror] diff --git a/core/resources.js b/core/resources.js index e307a96d..0987b1e9 100644 --- a/core/resources.js +++ b/core/resources.js @@ -130,6 +130,11 @@ var resources = { 'path': 'resources/prototype/{version}/prototype.jsm', 'type': 'application/javascript' }, + // Cloudflare Rocket Loader + 'cfRocketLoader': { + 'path': 'resources/rocket-loader/latest/rocket-loader.min.jsm', + 'type': 'application/javascript' + }, // Scriptaculous 'scriptaculous': { 'path': 'resources/scriptaculous/{version}/scriptaculous.jsm', diff --git a/modules/internal/helpers.js b/modules/internal/helpers.js index f38ea089..823b5d4d 100644 --- a/modules/internal/helpers.js +++ b/modules/internal/helpers.js @@ -183,6 +183,8 @@ helpers.determineCdnName = function (domainName) { return 'MaxCDN Bootstrap CDN'; case 'use.fontawesome.com': return 'Font Awesome CDN'; + case 'ajax.cloudflare.com': + return 'Cloudflare CDN'; default: return 'Unknown'; } @@ -204,6 +206,12 @@ helpers.determineResourceName = function (filename) { return 'AngularJS Touch'; case 'backbone-min.jsm': return 'Backbone.js'; + case 'bootstrap.min.cssm': + return 'Bootstrap CSS'; + case 'bootstrap.min.jsm': + return 'Bootstrap JS'; + case 'bootstrap-slider.min.cssm': + return 'bootstrap-slider'; case 'dojo.jsm': return 'Dojo'; case 'ember.min.jsm': @@ -230,6 +238,8 @@ helpers.determineResourceName = function (filename) { return 'page.js'; case 'prototype.jsm': return 'Prototype'; + case 'rocket-loader.min.jsm': + return 'Rocket Loader' case 'scriptaculous.jsm': return 'Scriptaculous'; case 'swfobject.jsm': @@ -240,12 +250,6 @@ helpers.determineResourceName = function (filename) { return 'Web Font Loader'; case 'vue.jsm': return 'Vue.js'; - case 'bootstrap.min.cssm': - return 'Bootstrap CSS'; - case 'bootstrap.min.jsm': - return 'Bootstrap JS'; - case 'bootstrap-slider.min.cssm': - return 'bootstrap-slider'; default: return 'Unknown'; } diff --git a/pages/popup/popup.js b/pages/popup/popup.js index b4abe0ce..7fe2daff 100644 --- a/pages/popup/popup.js +++ b/pages/popup/popup.js @@ -289,13 +289,13 @@ popup._createInjectionElement = function (injection) { nameTextNode = document.createTextNode(`- ${name}`); injectionElement.appendChild(nameTextNode); - noteElement = document.createElement('span'); - noteElement.setAttribute('class', 'side-note'); - - noteTextNode = document.createTextNode(` v${injection.version}`); - - noteElement.appendChild(noteTextNode); - injectionElement.appendChild(noteElement); + if (injection.version !== null) { + noteElement = document.createElement('span'); + noteElement.setAttribute('class', 'side-note'); + noteTextNode = document.createTextNode(` v${injection.version}`); + noteElement.appendChild(noteTextNode); + injectionElement.appendChild(noteElement); + } return injectionElement; }; diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 51759e8c..ae903c21 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -31,6 +31,7 @@
  • Fixed file extensions to prevent warnigns of Mozillas validation tests
  • Added new endpoint for webfont
  • Added new endpoint for bootstrap-slider
  • +
  • Added "ajax.cloudflare.com" and "Rocket Loader" ("#24")
  • Please update your uBlock/uMatrix rules diff --git a/resources/rocket-loader/latest/rocket-loader.min.jsm b/resources/rocket-loader/latest/rocket-loader.min.jsm new file mode 100644 index 00000000..71d05a06 --- /dev/null +++ b/resources/rocket-loader/latest/rocket-loader.min.jsm @@ -0,0 +1 @@ +!function(){"use strict";function t(){return"cf-marker-"+Math.random().toString().slice(2)}function e(){for(var t=[],e=0;e"+e.outerHTML+"":e.outerHTML;L.call(document,i);var a=document.querySelector("["+r+"]");if(a){a.removeAttribute(r);var c=n&&a.parentNode;c&&o(c)}return a}function f(t){if(t&&"handleEvent"in t){var e=t.handleEvent;return"function"==typeof e?e.bind(t):e}return t}function h(t,e,n){var r=n?function(t){return e.insertBefore(t,n)}:function(t){return e.appendChild(t)};Array.prototype.slice.call(t).forEach(r)}function v(){return/chrome/i.test(navigator.userAgent)&&/google/i.test(navigator.vendor)}function y(t,e){function n(){this.constructor=t}H(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function m(t){return t instanceof Window?["load"]:t instanceof Document?["DOMContentLoaded","readystatechange"]:[]}function b(t){var e=t.getAttribute(R);if(!e)return null;var n=e.split(T);return{nonce:n[0],handlerPrefixLength:+n[1],bailout:!t.hasAttribute("defer")}}function g(t){var e=B+t.nonce;Array.prototype.forEach.call(document.querySelectorAll("["+e+"]"),function(n){n.removeAttribute(e),Array.prototype.forEach.call(n.attributes,function(e){/^on/.test(e.name)&&"function"!=typeof n[e.name]&&n.setAttribute(e.name,e.value.substring(t.handlerPrefixLength))})})}function S(){var t=window;"undefined"!=typeof Promise&&(t.__cfQR={done:new Promise(function(t){return U=t})})}function w(t){var e=new N(t),n=new C(e);e.harvestScriptsInDocument(),new W(e,{nonce:t,blocking:!0,docWriteSimulator:n,callback:function(){}}).run()}function x(t){var e=new N(t),n=new C(e);e.harvestScriptsInDocument();var r=new W(e,{nonce:t,blocking:!1,docWriteSimulator:n,callback:function(){window.__cfRLUnblockHandlers=!0,r.removePreloadHints(),P(t)}});r.insertPreloadHints(),M.runOnLoad(function(){r.run()})}function P(t){var e=new O(t);M.simulateStateBeforeDeferScriptsActivation(),e.harvestDeferScriptsInDocument(),new W(e,{nonce:t,blocking:!1,callback:function(){M.simulateStateAfterDeferScriptsActivation(),U&&U()}}).run()}var E="http://www.w3.org/2000/svg",A={"application/ecmascript":!0,"application/javascript":!0,"application/x-ecmascript":!0,"application/x-javascript":!0,"text/ecmascript":!0,"text/javascript":!0,"text/javascript1.0":!0,"text/javascript1.1":!0,"text/javascript1.2":!0,"text/javascript1.3":!0,"text/javascript1.4":!0,"text/javascript1.5":!0,"text/jscript":!0,"text/livescript":!0,"text/x-ecmascript":!0,"text/x-javascript":!0,module:!0},k=void 0!==document.createElement("script").noModule,I=function(){var t=window;return t.__rocketLoaderEventCtor||Object.defineProperty(t,"__rocketLoaderEventCtor",{value:Event}),t.__rocketLoaderEventCtor}(),L=document.write,_=document.writeln,H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},D=function(){function t(t){this.nonce=t,this.items=[]}return Object.defineProperty(t.prototype,"hasItems",{get:function(){return this.items.length>0},enumerable:!0,configurable:!0}),t.prototype.pop=function(){return this.items.pop()},t.prototype.forEach=function(t){this.items.forEach(function(e){var n=e.script;return t(n)})},t.prototype.harvestScripts=function(t,e){var n=this,r=e.filter,o=e.mutate;Array.prototype.slice.call(t.querySelectorAll("script")).filter(r).reverse().forEach(function(t){o(t),n.pushScriptOnStack(t)})},t.prototype.pushScriptOnStack=function(t){var e=t.parentNode,n=this.createPlaceholder(t),r=!!i(t);e.replaceChild(n,t),this.items.push({script:t,placeholder:n,external:r,async:r&&t.hasAttribute("async"),executable:c(t)})},t.prototype.hasNonce=function(t){return 0===t.type.indexOf(this.nonce)},t.prototype.removeNonce=function(t){t.type=t.type.substr(this.nonce.length)},t.prototype.makeNonExecutable=function(t){t.type=this.nonce+t.type},t.prototype.isPendingDeferScript=function(t){return t.hasAttribute("defer")||t.type===this.nonce+"module"&&!t.hasAttribute("async")},t}(),N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e.prototype.harvestScriptsInDocument=function(){var t=this;this.harvestScripts(document,{filter:function(e){return t.hasNonce(e)},mutate:function(e){t.isPendingDeferScript(e)||t.removeNonce(e)}})},e.prototype.harvestScriptsAfterDocWrite=function(t){var e=this;this.harvestScripts(t,{filter:c,mutate:function(t){e.isPendingDeferScript(t)&&e.makeNonExecutable(t)}})},e.prototype.createPlaceholder=function(t){return document.createComment(t.outerHTML)},e}(D),O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e.prototype.harvestDeferScriptsInDocument=function(){var t=this;this.harvestScripts(document,{filter:function(e){return t.hasNonce(e)&&t.isPendingDeferScript(e)},mutate:function(e){return t.removeNonce(e)}})},e.prototype.createPlaceholder=function(t){var e=p(t);return this.makeNonExecutable(e),e},e}(D),C=function(){function t(t){this.scriptStack=t}return t.prototype.enable=function(t){var e=this;this.insertionPointMarker=t,this.buffer="",document.write=function(){for(var t=[],n=0;n",o=t.parseFromString(e,"text/html");if(this.scriptStack.harvestScriptsAfterDocWrite(o),n(o.head.childNodes,this.insertionPointMarker),o.body.childNodes.length){for(var i=Array.prototype.slice.call(o.body.childNodes),a=this.insertionPointMarker.nextSibling;a;)i.push(a),a=a.nextSibling;document.body||L.call(document,""),r(i,document.body)}},t.prototype.insertContentInBody=function(){var t=this.insertionPointMarker.parentElement,e=document.createElement(t.tagName);e.innerHTML=this.buffer,this.scriptStack.harvestScriptsAfterDocWrite(e),n(e.childNodes,this.insertionPointMarker)},t.prototype.write=function(t,e){var n=document.currentScript;n&&i(n)&&n.hasAttribute("async")?(r=e?_:L).call.apply(r,[document].concat(t)):this.buffer+=t.map(String).join(e?"\n":"");var r},t}(),j=function(){function t(){var t=this;this.simulatedReadyState="loading",this.bypassEventsInProxies=!1,this.nativeWindowAddEventListener=window.addEventListener;try{Object.defineProperty(document,"readyState",{get:function(){return t.simulatedReadyState}})}catch(e){}this.setupEventListenerProxy(),this.updateInlineHandlers()}return t.prototype.runOnLoad=function(t){var e=this;this.nativeWindowAddEventListener.call(window,"load",function(n){if(!e.bypassEventsInProxies)return t(n)})},t.prototype.updateInlineHandlers=function(){this.proxyInlineHandler(document,"onreadystatechange"),this.proxyInlineHandler(window,"onload"),document.body&&this.proxyInlineHandler(document.body,"onload")},t.prototype.simulateStateBeforeDeferScriptsActivation=function(){this.bypassEventsInProxies=!0,this.simulatedReadyState="interactive",l(document,"readystatechange"),this.bypassEventsInProxies=!1},t.prototype.simulateStateAfterDeferScriptsActivation=function(){var t=this;this.bypassEventsInProxies=!0,l(document,"DOMContentLoaded"),this.simulatedReadyState="complete",l(document,"readystatechange"),l(window,"load"),this.bypassEventsInProxies=!1,window.setTimeout(function(){return t.bypassEventsInProxies=!0},0)},t.prototype.setupEventListenerProxy=function(){var t=this;("undefined"!=typeof EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]).forEach(function(e){return t.patchEventTargetMethods(e)})},t.prototype.patchEventTargetMethods=function(t){var e=this,n=t.addEventListener,r=t.removeEventListener;t.addEventListener=function(t,r){for(var o=[],i=2;i