From 3cc6a80922103fe09fc67f4d2902421135ee6da1 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 24 Apr 2015 15:52:16 -0600 Subject: [PATCH] Code review --- assets/ublock/filters.txt | 4 ++++ platform/safari/vapi-client.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/assets/ublock/filters.txt b/assets/ublock/filters.txt index 183647d97..2086721ce 100644 --- a/assets/ublock/filters.txt +++ b/assets/ublock/filters.txt @@ -309,3 +309,7 @@ deviantart.com##.dp-ad-chrome.dp-ad-visible # Also fixes https://github.com/chrisaljoudi/uBlock/issues/1271 # NBA.com @@||cdn.turner.com/*/AdManager.js$domain=cnn.com|nba.com,script + + +# To deal with https://github.com/chrisaljoudi/uBlock/issues/1013 +||mac-system-alert.com^ diff --git a/platform/safari/vapi-client.js b/platform/safari/vapi-client.js index c02270014..1f77f6142 100644 --- a/platform/safari/vapi-client.js +++ b/platform/safari/vapi-client.js @@ -230,8 +230,13 @@ var meta = document.createElement('meta'); meta.setAttribute("http-equiv", "content-security-policy"); meta.setAttribute("content", "script-src 'unsafe-eval' *"); + if(document.documentElement.firstChild) { + document.documentElement.insertBefore(meta, document.documentElement.firstChild); + } + else { + document.documentElement.appendChild(meta); + } } - document.documentElement.insertBefore(meta, document.documentElement.firstChild); document.addEventListener(vAPI.sessionId, function(e) { if(shouldBlockDetailedRequest(e.detail)) { e.detail.url = false;