aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeathamns <deathamns@gmail.com>2014-11-04 12:32:44 +0100
committerDeathamns <deathamns@gmail.com>2014-11-09 17:41:02 +0100
commitd98a8161f9ef23992b88aa1f8c6a17eae45e7959 (patch)
treee6ab346b0aa93f1cd784814dc6a245d2b7ba19e1
parentba0b11aabe810c6d0d29b9daf9741ec758272385 (diff)
downloaduBlock-d98a8161f9ef23992b88aa1f8c6a17eae45e7959.zip
uBlock-d98a8161f9ef23992b88aa1f8c6a17eae45e7959.tar.gz
uBlock-d98a8161f9ef23992b88aa1f8c6a17eae45e7959.tar.bz2
Drop js-loader, updates from gorhill/uBlock/master
-rw-r--r--meta/config.json2
-rw-r--r--src/1p-filters.html14
-rw-r--r--src/3p-filters.html18
-rw-r--r--src/Info.plist4
-rw-r--r--src/about.html16
-rw-r--r--src/asset-viewer.html8
-rw-r--r--src/dashboard.html10
-rw-r--r--src/js/assets.js4
-rw-r--r--src/js/element-picker.js7
-rw-r--r--src/js/js-loader.js39
-rw-r--r--src/js/sitepatch-safari.js5
-rw-r--r--src/js/vapi-appinfo.js2
-rw-r--r--src/js/vapi-client.js16
-rw-r--r--src/popup.html14
-rw-r--r--src/settings.html14
-rw-r--r--src/stats.html14
-rw-r--r--src/whitelist.html16
17 files changed, 77 insertions, 126 deletions
diff --git a/meta/config.json b/meta/config.json
index a396a7d..8d9af82 100644
--- a/meta/config.json
+++ b/meta/config.json
@@ -4,7 +4,7 @@
"url": "https://github.com/gorhill/uBlock",
"author": "Raymond Hill",
"author_email": "rhill@raymondhill.net",
- "version": "0.7.0.7",
+ "version": "0.7.0.9",
"def_lang": "en",
"vendors": {
"crx": {
diff --git a/src/1p-filters.html b/src/1p-filters.html
index 1705b5f..8425d6e 100644
--- a/src/1p-filters.html
+++ b/src/1p-filters.html
@@ -18,14 +18,12 @@
<p><button id="userFiltersApply" disabled="true" data-i18n="1pApplyChanges"></button></p>
</div>
-<script src="js/js-loader.js" data-jsList="
-js/vapi-common.js
-js/vapi-client.js
-js/udom.js
-js/i18n.js
-js/dashboard-common.js
-js/1p-filters.js
-"></script>
+<script src="js/vapi-common.js"></script>
+<script src="js/vapi-client.js"></script>
+<script src="js/udom.js"></script>
+<script src="js/i18n.js"></script>
+<script src="js/dashboard-common.js"></script>
+<script src="js/1p-filters.js"></script>
</body>
</html>
diff --git a/src/3p-filters.html b/src/3p-filters.html
index 5e6198a..3ee5213 100644
--- a/src/3p-filters.html
+++ b/src/3p-filters.html
@@ -31,16 +31,14 @@
<div id="busyOverlay"></div>
-<script src="js/js-loader.js" data-jsList="
-lib/publicsuffixlist.min.js
-js/vapi-common.js
-js/vapi-client.js
-js/udom.js
-js/i18n.js
-js/uritools.js
-js/dashboard-common.js
-js/3p-filters.js
-"></script>
+<script src="lib/publicsuffixlist.min.js"></script>
+<script src="js/vapi-common.js"></script>
+<script src="js/vapi-client.js"></script>
+<script src="js/udom.js"></script>
+<script src="js/i18n.js"></script>
+<script src="js/uritools.js"></script>
+<script src="js/dashboard-common.js"></script>
+<script src="js/3p-filters.js"></script>
</body>
</html>
diff --git a/src/Info.plist b/src/Info.plist
index 12c1ae9..bcb0673 100644
--- a/src/Info.plist
+++ b/src/Info.plist
@@ -13,9 +13,9 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
- <string>0.7.0.8</string>
+ <string>0.7.0.9</string>
<key>CFBundleVersion</key>
- <string>1454679</string>
+ <string>1455205</string>
<key>Chrome</key>
<dict>
<key>Database Quota</key>
diff --git a/src/about.html b/src/about.html
index e7507c0..101ffd6 100644
--- a/src/about.html
+++ b/src/about.html
@@ -31,15 +31,13 @@
<p><button type="button" id="reset" data-i18n="aboutResetDataButton"></button>
</div>
-<script src="js/js-loader.js" data-jsList="
-js/vapi-common.js
-js/vapi-client.js
-js/vapi-appinfo.js
-js/udom.js
-js/i18n.js
-js/dashboard-common.js
-js/about.js
-"></script>
+<script src="js/vapi-common.js"></script>
+<script src="js/vapi-client.js"></script>
+<script src="js/vapi-appinfo.js"></script>
+<script src="js/udom.js"></script>
+<script src="js/i18n.js"></script>
+<script src="js/dashboard-common.js"></script>
+<script src="js/about.js"></script>
</body>
</html>
diff --git a/src/asset-viewer.html b/src/asset-viewer.html
index 103b9d8..8809125 100644
--- a/src/asset-viewer.html
+++ b/src/asset-viewer.html
@@ -13,11 +13,9 @@
<body>
<div id="content"></div>
-<script src="js/js-loader.js" data-jsList="
-js/udom.js
-js/vapi-client.js
-js/asset-viewer.js
-"></script>
+<script src="js/udom.js"></script>
+<script src="js/vapi-client.js"></script>
+<script src="js/asset-viewer.js"></script>
</body>
</html>
diff --git a/src/dashboard.html b/src/dashboard.html
index 75b9638..bc53db0 100644
--- a/src/dashboard.html
+++ b/src/dashboard.html
@@ -22,12 +22,10 @@
<iframe src=""></iframe>
-<script src="js/js-loader.js" data-jsList="
-js/vapi-common.js
-js/udom.js
-js/i18n.js
-js/dashboard.js
-"></script>
+<script src="js/vapi-common.js"></script>
+<script src="js/udom.js"></script>
+<script src="js/i18n.js"></script>
+<script src="js/dashboard.js"></script>
</body>
</html>
diff --git a/src/js/assets.js b/src/js/assets.js
index 83b07e8..737dea6 100644
--- a/src/js/assets.js
+++ b/src/js/assets.js
@@ -229,7 +229,9 @@ var cachedAssetsManager = (function() {
var getTextFileFromURL = function(url, onLoad, onError) {
// https://github.com/gorhill/uMatrix/issues/15
var onResponseReceived = function() {
- if ( typeof this.status === 'number' && this.status >= 200 && this.status < 300 ) {
+ // xhr for local files gives status 0, but actually succeeds
+ if ( this.status >= 200 && this.status < 300
+ || this.status === 0 && this.responseText ) {
return onLoad.call(this);
}
return onError.call(this);
diff --git a/src/js/element-picker.js b/src/js/element-picker.js
index fa29f6a..9cf4a32 100644
--- a/src/js/element-picker.js
+++ b/src/js/element-picker.js
@@ -120,6 +120,11 @@
/******************************************************************************/
+// don't run in frames
+if (window.top !== window) {
+ return;
+}
+
// https://github.com/gorhill/uBlock/issues/314#issuecomment-58878112
// Using an id makes uBlock's CSS rules more specific, thus prevents
// surrounding external rules from winning over own rules.
@@ -874,7 +879,7 @@ var startPicker = function(details) {
].join('');
pickerRoot.appendChild(divDialog);
- // https://github.com/gorhill/uBlock/issues/344#issuecomment-60775958
+ // https://github.com/gorhill/uBlock/issues/344#issuecomment-60775958
// Insert in `html` tag, not `body` tag.
document.documentElement.appendChild(pickerRoot);
svgRoot.addEventListener('click', onSvgClicked);
diff --git a/src/js/js-loader.js b/src/js/js-loader.js
deleted file mode 100644
index cd60baa..0000000
--- a/src/js/js-loader.js
+++ /dev/null
@@ -1,39 +0,0 @@
-(function() {
- 'use strict';
-
- document.body.style.display = "none";
- document.addEventListener("DOMContentLoaded", function onDOMReady(e) {
- document.removeEventListener(e.type, onDOMReady, false);
-
- var jsListToLoad = document.querySelector("script[data-jsList]");
-
- if (jsListToLoad) {
- jsListToLoad = jsListToLoad.getAttribute("data-jsList").trim().split(/\s+/);
- }
-
- if (Array.isArray(jsListToLoad)) {
- var loadNextJSFile = function() {
- var script, src = jsListToLoad.shift();
-
- if (src) {
- script = document.createElement("script");
- script.onload = function() {
- this.onload = null;
-
- if (jsListToLoad.length) {
- loadNextJSFile();
- }
- else {
- document.body.style.display = "";
- jsListToLoad = document.querySelector("script[data-jsList]");
- jsListToLoad.parentNode.removeChild(jsListToLoad);
- }
- };
- document.body.appendChild(script).src = src;
- }
- };
-
- loadNextJSFile();
- }
- }, false);
-})(); \ No newline at end of file
diff --git a/src/js/sitepatch-safari.js b/src/js/sitepatch-safari.js
index e4eee90..4c4e9f6 100644
--- a/src/js/sitepatch-safari.js
+++ b/src/js/sitepatch-safari.js
@@ -9,7 +9,7 @@ self.vAPI = self.vAPI || {};
if (/^www\.youtube(-nocookie)?\.com/.test(location.host)) {
vAPI.sitePatch = function() {
- window.addEventListener('load', function onWindowLoad() {
+ var onWindowLoad = function() {
this.removeEventListener('load', onWindowLoad, true);
var spf = this._spf_state;
@@ -19,7 +19,8 @@ if (/^www\.youtube(-nocookie)?\.com/.test(location.host)) {
window.location.href = url;
};
}
- }, true);
+ };
+ window.addEventListener('load', onWindowLoad, true);
// based on ExtendTube's ad removing solution
diff --git a/src/js/vapi-appinfo.js b/src/js/vapi-appinfo.js
index 2dea72c..372fc04 100644
--- a/src/js/vapi-appinfo.js
+++ b/src/js/vapi-appinfo.js
@@ -5,6 +5,6 @@ self.vAPI = self.vAPI || {};
vAPI.app = {
/**/name: 'µBlock',
- /**/version: '0.7.0.7',
+ /**/version: '0.7.0.9',
/**/url: 'https://github.com/gorhill/uBlock',
}; \ No newline at end of file
diff --git a/src/js/vapi-client.js b/src/js/vapi-client.js
index 071f813..51d7311 100644
--- a/src/js/vapi-client.js
+++ b/src/js/vapi-client.js
@@ -74,14 +74,14 @@ if (self.chrome) {
return;
}
- if (!this.listenerId) {
- this.setup();
- }
-
this.channels[name] = {
portName: name,
listener: typeof callback === 'function' ? callback : null,
send: function(message, callback) {
+ if (!vAPI.messaging.listenerId) {
+ vAPI.messaging.setup();
+ }
+
message = {
portName: this.portName,
msg: message
@@ -137,14 +137,14 @@ if (self.chrome) {
return;
}
- if (!this._connector) {
- this.setup();
- }
-
this.channels[name] = {
portName: name,
listener: typeof callback === 'function' ? callback : null,
send: function(message, callback) {
+ if (!vAPI.messaging._connector) {
+ vAPI.messaging.setup();
+ }
+
message = {
portName: this.portName,
msg: message
diff --git a/src/popup.html b/src/popup.html
index 535dfc0..8857d86 100644
--- a/src/popup.html
+++ b/src/popup.html
@@ -52,14 +52,12 @@
<div class="label">&lt;iframe&gt;</div>
</div>
</div>
-<script src="js/js-loader.js" data-jsList="
-js/vapi-common.js
-js/vapi-client.js
-js/vapi-appinfo.js
-js/udom.js
-js/i18n.js
-js/popup.js
-"></script>
+<script src="js/vapi-common.js"></script>
+<script src="js/vapi-client.js"></script>
+<script src="js/vapi-appinfo.js"></script>
+<script src="js/udom.js"></script>
+<script src="js/i18n.js"></script>
+<script src="js/popup.js"></script>
</body>
diff --git a/src/settings.html b/src/settings.html
index 1f96982..34c57ee 100644
--- a/src/settings.html
+++ b/src/settings.html
@@ -25,14 +25,12 @@ ul {
(<a href="https://github.com/gorhill/uBlock/wiki/Experimental-features" style="font-style:italic">Experimental features</a>)
</ul>
-<script src="js/js-loader.js" data-jsList="
-js/vapi-common.js
-js/vapi-client.js
-js/udom.js
-js/i18n.js
-js/dashboard-common.js
-js/settings.js
-"></script>
+<script src="js/vapi-common.js"></script>
+<script src="js/vapi-client.js"></script>
+<script src="js/udom.js"></script>
+<script src="js/i18n.js"></script>
+<script src="js/dashboard-common.js"></script>
+<script src="js/settings.js"></script>
</body>
</html>
diff --git a/src/stats.html b/src/stats.html
index b6ca1f5..ab3187e 100644
--- a/src/stats.html
+++ b/src/stats.html
@@ -29,14 +29,12 @@
</div>
-<script src="js/js-loader.js" data-jsList="
-js/vapi-common.js
-js/vapi-client.js
-js/udom.js
-js/i18n.js
-js/dashboard-common.js
-js/stats.js
-"></script>
+<script src="js/vapi-common.js"></script>
+<script src="js/vapi-client.js"></script>
+<script src="js/udom.js"></script>
+<script src="js/i18n.js"></script>
+<script src="js/dashboard-common.js"></script>
+<script src="js/stats.js"></script>
</body>
</html>
diff --git a/src/whitelist.html b/src/whitelist.html
index c1a0b0a..2a5789f 100644
--- a/src/whitelist.html
+++ b/src/whitelist.html
@@ -18,15 +18,13 @@
<p><button id="whitelistApply" type="button" disabled="true" data-i18n="whitelistApply"></button></p>
</div>
-<script src="js/js-loader.js" data-jsList="
-lib/punycode.min.js
-js/vapi-common.js
-js/vapi-client.js
-js/udom.js
-js/i18n.js
-js/dashboard-common.js
-js/whitelist.js
-"></script>
+<script src="lib/punycode.min.js"></script>
+<script src="js/vapi-common.js"></script>
+<script src="js/vapi-client.js"></script>
+<script src="js/udom.js"></script>
+<script src="js/i18n.js"></script>
+<script src="js/dashboard-common.js"></script>
+<script src="js/whitelist.js"></script>
</body>
</html>