Index: mobile-options.js |
=================================================================== |
--- a/mobile-options.js |
+++ b/mobile-options.js |
@@ -15,17 +15,17 @@ |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
/* globals getDocLink */ |
"use strict"; |
{ |
- const {getMessage} = chrome.i18n; |
+ const {getMessage} = browser.i18n; |
const dialogSubscribe = "subscribe"; |
const idAcceptableAds = "acceptableAds"; |
const idRecommended = "subscriptions-recommended"; |
let whitelistFilter = null; |
let promisedAcceptableAdsUrl = getAcceptableAdsUrl(); |
/* Utility functions */ |
@@ -71,28 +71,28 @@ |
} |
/* Extension interactions */ |
function getInstalled() |
{ |
return new Promise((resolve, reject) => |
{ |
- chrome.runtime.sendMessage( |
+ browser.runtime.sendMessage( |
{type: "subscriptions.get", downloadable: true}, |
resolve |
); |
}); |
} |
function getAcceptableAdsUrl() |
{ |
return new Promise((resolve, reject) => |
{ |
- chrome.runtime.sendMessage( |
+ browser.runtime.sendMessage( |
{type: "prefs.get", key: "subscriptions_exceptionsurl"}, |
resolve |
); |
}); |
} |
function getRecommendedAds() |
{ |
@@ -112,22 +112,22 @@ |
url: element.getAttribute("url") |
}; |
}); |
}); |
} |
function installSubscription(url, title) |
{ |
- chrome.runtime.sendMessage({type: "subscriptions.add", url, title}); |
+ browser.runtime.sendMessage({type: "subscriptions.add", url, title}); |
} |
function uninstallSubscription(url) |
{ |
- chrome.runtime.sendMessage({type: "subscriptions.remove", url}); |
+ browser.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) |
{ |
- chrome.runtime.sendMessage( |
+ browser.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); |
- chrome.runtime.sendMessage({ |
+ browser.runtime.sendMessage({ |
type: "app.listen", |
filter: ["addSubscription", "showPageOptions"] |
}); |
- chrome.runtime.sendMessage({ |
+ browser.runtime.sendMessage({ |
type: "filters.listen", |
filter: ["added", "removed"] |
}); |
- chrome.runtime.sendMessage({ |
+ browser.runtime.sendMessage({ |
type: "subscriptions.listen", |
filter: ["added", "disabled", "removed", "title"] |
}); |
/* Initialization */ |
populateLists(); |