Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: desktop-options.js

Issue 29570614: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Refactor polyfill.js Created Oct. 10, 2017, 10:39 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « desktop-options.html ('k') | devtools.html » ('j') | polyfill.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: desktop-options.js
===================================================================
--- a/desktop-options.js
+++ b/desktop-options.js
@@ -86,17 +86,17 @@
let delayedSubscriptionSelection = null;
let acceptableAdsUrl;
// Loads options from localStorage and sets UI elements accordingly
function loadOptions()
{
// Set page title to i18n version of "Adblock Plus Options"
- document.title = chrome.i18n.getMessage("options");
+ document.title = browser.i18n.getMessage("options");
// Set links
getPref("subscriptions_exceptionsurl", url =>
{
acceptableAdsUrl = url;
$("#acceptableAdsLink").attr("href", acceptableAdsUrl);
});
getDocLink("acceptable_ads", url =>
@@ -300,17 +300,17 @@
selectedPrefix = prefix;
}
}
}
list.appendChild(option);
}
let option = new Option();
- let label = chrome.i18n.getMessage("filters_addSubscriptionOther_label");
+ let label = browser.i18n.getMessage("filters_addSubscriptionOther_label");
option.text = label + "\u2026";
option._data = null;
list.appendChild(option);
list.selectedIndex = selectedIndex;
if (delayedSubscriptionSelection)
startSubscriptionSelection(...delayedSubscriptionSelection);
@@ -360,17 +360,17 @@
if (data)
addSubscription(data.url, data.title, data.homepage);
else
{
let url = document.getElementById("customSubscriptionLocation")
.value.trim();
if (!/^https?:/i.test(url))
{
- alert(chrome.i18n.getMessage("global_subscription_invalid_location"));
+ alert(browser.i18n.getMessage("global_subscription_invalid_location"));
$("#customSubscriptionLocation").focus();
return;
}
let title = document.getElementById("customSubscriptionTitle").value.trim();
if (!title)
title = url;
@@ -416,37 +416,37 @@
enabled.checked = !subscription.disabled;
let lastUpdate = element.getElementsByClassName("subscriptionUpdate")[0];
lastUpdate.classList.remove("error");
let {downloadStatus} = subscription;
if (subscription.isDownloading)
{
- lastUpdate.textContent = chrome.i18n.getMessage(
+ lastUpdate.textContent = browser.i18n.getMessage(
"filters_subscription_lastDownload_inProgress"
);
}
else if (downloadStatus && downloadStatus != "synchronize_ok")
{
if (statusMessages.has(downloadStatus))
{
- lastUpdate.textContent = chrome.i18n.getMessage(
+ lastUpdate.textContent = browser.i18n.getMessage(
statusMessages.get(downloadStatus)
);
}
else
lastUpdate.textContent = downloadStatus;
lastUpdate.classList.add("error");
}
else if (subscription.lastDownload > 0)
{
let timeDate = i18nTimeDateStrings(subscription.lastDownload * 1000);
let messageID = (timeDate[1] ? "last_updated_at" : "last_updated_at_today");
- lastUpdate.textContent = chrome.i18n.getMessage(messageID, timeDate);
+ lastUpdate.textContent = browser.i18n.getMessage(messageID, timeDate);
}
}
function onSubscriptionMessage(action, subscription)
{
let element = findSubscriptionElement(subscription);
switch (action)
@@ -651,17 +651,17 @@
let removeButton = element.getElementsByClassName(
"subscriptionRemoveButton"
)[0];
removeButton.setAttribute("title", removeButton.textContent);
removeButton.textContent = "\xD7";
removeButton.addEventListener("click", () =>
{
- if (!confirm(chrome.i18n.getMessage("global_remove_subscription_warning")))
+ if (!confirm(browser.i18n.getMessage("global_remove_subscription_warning")))
return;
removeSubscription(subscription.url);
}, false);
getPref("additional_subscriptions", additionalSubscriptions =>
{
if (additionalSubscriptions.includes(subscription.url))
« no previous file with comments | « desktop-options.html ('k') | devtools.html » ('j') | polyfill.js » ('J')

Powered by Google App Engine
This is Rietveld