Index: options.js |
=================================================================== |
--- a/options.js |
+++ b/options.js |
@@ -718,7 +718,14 @@ |
function(features) |
{ |
hidePref("show_devtools_panel", !features.devToolsPanel); |
- hidePref("safari_contentblocker", !features.safariContentBlocker); |
+ |
+ // Only show option to switch between Safari Content Blockers |
+ // and event based blocking if both are available. |
+ hidePref("safari_contentblocker", !( |
+ features.safariContentBlocker && |
+ "canLoad" in safari.self.tab && |
+ "onbeforeload" in Element.prototype |
+ )); |
}); |
var filterTextbox = document.querySelector("#custom-filters-add input"); |
@@ -1080,13 +1087,18 @@ |
switch (message.type) |
{ |
case "app.respond": |
- if (message.action == "addSubscription") |
+ switch (message.action) |
{ |
- var subscription = message.args[0]; |
- var dialog = E("dialog-content-predefined"); |
- dialog.querySelector("h3").textContent = subscription.title || ""; |
- dialog.querySelector(".url").textContent = subscription.url; |
- openDialog("predefined"); |
+ case "addSubscription": |
+ var subscription = message.args[0]; |
+ var dialog = E("dialog-content-predefined"); |
+ dialog.querySelector("h3").textContent = subscription.title || ""; |
+ dialog.querySelector(".url").textContent = subscription.url; |
+ openDialog("predefined"); |
+ break; |
+ case "safariRestartRequired": |
+ E("restart-safari").setAttribute("aria-hidden", !message.args[0]); |
+ break; |
} |
break; |
case "filters.respond": |
@@ -1104,7 +1116,7 @@ |
ext.backgroundPage.sendMessage( |
{ |
type: "app.listen", |
- filter: ["addSubscription"] |
+ filter: ["addSubscription", "safariRestartRequired"] |
}); |
ext.backgroundPage.sendMessage( |
{ |