Index: mobile-options.js |
=================================================================== |
--- a/mobile-options.js |
+++ b/mobile-options.js |
@@ -71,28 +71,28 @@ |
} |
/* Extension interactions */ |
function getInstalled() |
{ |
return new Promise((resolve, reject) => |
{ |
- ext.backgroundPage.sendMessage( |
+ chrome.runtime.sendMessage( |
{type: "subscriptions.get", downloadable: true}, |
resolve |
); |
}); |
} |
function getAcceptableAdsUrl() |
{ |
return new Promise((resolve, reject) => |
{ |
- ext.backgroundPage.sendMessage( |
+ chrome.runtime.sendMessage( |
{type: "prefs.get", key: "subscriptions_exceptionsurl"}, |
resolve |
); |
}); |
} |
function getRecommendedAds() |
{ |
@@ -112,22 +112,22 @@ |
url: element.getAttribute("url") |
}; |
}); |
}); |
} |
function installSubscription(url, title) |
{ |
- ext.backgroundPage.sendMessage({type: "subscriptions.add", url, title}); |
+ chrome.runtime.sendMessage({type: "subscriptions.add", url, title}); |
} |
function uninstallSubscription(url) |
{ |
- ext.backgroundPage.sendMessage({type: "subscriptions.remove", url}); |
+ chrome.runtime.sendMessage({type: "subscriptions.remove", url}); |
} |
/* Actions */ |
function setFilter({disabled, text}, action) |
{ |
if (!whitelistFilter || text != whitelistFilter) |
return; |
@@ -285,17 +285,17 @@ |
}); |
} |
document.addEventListener("change", onChange); |
function toggleWhitelistFilter(toggle) |
{ |
if (whitelistFilter) |
{ |
- ext.backgroundPage.sendMessage( |
+ chrome.runtime.sendMessage( |
{ |
type: (toggle.checked) ? "filters.remove" : "filters.add", |
text: whitelistFilter |
}, |
(errors) => |
{ |
if (errors.length < 1) |
return; |
@@ -408,27 +408,27 @@ |
break; |
} |
break; |
} |
} |
} |
ext.onMessage.addListener(onMessage); |
- ext.backgroundPage.sendMessage({ |
+ chrome.runtime.sendMessage({ |
type: "app.listen", |
filter: ["addSubscription", "showPageOptions"] |
}); |
- ext.backgroundPage.sendMessage({ |
+ chrome.runtime.sendMessage({ |
type: "filters.listen", |
filter: ["added", "removed"] |
}); |
- ext.backgroundPage.sendMessage({ |
+ chrome.runtime.sendMessage({ |
type: "subscriptions.listen", |
filter: ["added", "disabled", "removed", "title"] |
}); |
/* Initialization */ |
populateLists(); |