Index: safari/include.youtube.js |
diff --git a/safari/include.youtube.js b/safari/include.youtube.js |
index 0ad0bc2ed4011681293b8d23dfd01c25a38c9352..8d151ef944954938969a23dbddae310ed0f82acb 100644 |
--- a/safari/include.youtube.js |
+++ b/safari/include.youtube.js |
@@ -19,6 +19,22 @@ |
if (document.domain != "www.youtube.com") |
return; |
+ var usingContentBlockerAPI = true; |
+ try |
+ { |
+ if (safari.self.tab.canLoad(beforeLoadEvent, |
+ {category: "request", |
+ payload: {type: "prefs.get", |
+ key: "safariContentBlocker"}}) != true) |
+ usingContentBlockerAPI = false; |
+ } |
+ catch (e) |
+ { |
+ } |
+ |
+ if (usingContentBlockerAPI) |
+ return; |
+ |
if (ext.backgroundPage.sendMessageSync({type: "filters.isPageWhitelisted"})) |
return; |
@@ -33,7 +49,7 @@ |
return pairs.join("&"); |
} |
- function patchPlayer(player) |
+ function patchPlayer(player) |
{ |
var newPlayer = player.cloneNode(true); |
var flashvarsChanged = false; |