aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris <chris@chrismatic.io>2015-02-09 18:14:27 -0700
committerChris <chris@chrismatic.io>2015-02-09 18:15:52 -0700
commitfe28a9edbf3d910fce64e85a1b0c1dc8747401bf (patch)
tree8c1717bf013a3226ccbd59c8776631113330bb76
parent0acb14c5a01fe4da277df45a64dbd1de13c9b5cc (diff)
downloaduBlock-fe28a9edbf3d910fce64e85a1b0c1dc8747401bf.zip
uBlock-fe28a9edbf3d910fce64e85a1b0c1dc8747401bf.tar.gz
uBlock-fe28a9edbf3d910fce64e85a1b0c1dc8747401bf.tar.bz2
Safari: fixes #741. Now only HTTP/S requests are captured
-rw-r--r--platform/safari/vapi-client.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/safari/vapi-client.js b/platform/safari/vapi-client.js
index 1d27e69..f38f615 100644
--- a/platform/safari/vapi-client.js
+++ b/platform/safari/vapi-client.js
@@ -157,7 +157,8 @@
// Helper event to message background,
// and helper anchor element
var beforeLoadEvent = new Event("beforeload"),
- linkHelper = document.createElement("a");
+ linkHelper = document.createElement("a"),
+ isHttp_s = /^https?:/;
// Inform that we've navigated
if(frameId === 0) {
@@ -183,9 +184,9 @@
details.parentFrameId = parentFrameId;
details.timeStamp = Date.now();
return !(safari.self.tab.canLoad(beforeLoadEvent, details));
- }
+ };
var onBeforeLoad = function(e) {
- if(e.url.lastIndexOf("data:", 0) === 0) {
+ if(e.url.charCodeAt(0) !== 104 && !isHttp_s.test(e.url)) { // h = 104
return;
}
linkHelper.href = e.url;