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

Unified Diff: lib/filterComposer.js

Issue 29570614: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Update buildtools dependency Created Oct. 16, 2017, 12:10 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 | « lib/devtools.js ('k') | lib/filterValidation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterComposer.js
===================================================================
--- a/lib/filterComposer.js
+++ b/lib/filterComposer.js
@@ -162,17 +162,17 @@
filters.push(docDomain.replace(/^www\./, "") + "##" + selector);
}
}
return {filters, selectors};
}
let contextMenuItem = {
- title: chrome.i18n.getMessage("block_element"),
+ title: browser.i18n.getMessage("block_element"),
contexts: ["image", "video", "audio"],
onclick(page)
{
page.sendMessage({type: "composer.content.contextMenuClicked"});
}
};
function updateContextMenu(page, filter)
@@ -190,17 +190,17 @@
page.contextMenus.create(contextMenuItem);
}
}
FilterNotifier.on("page.WhitelistingStateRevalidate", updateContextMenu);
Prefs.on("shouldShowBlockElementMenu", () =>
{
- chrome.tabs.query({}, tabs =>
+ browser.tabs.query({}, tabs =>
{
for (let tab of tabs)
updateContextMenu(new ext.Page(tab));
});
});
port.on("composer.isPageReady", (message, sender) =>
{
@@ -213,17 +213,17 @@
updateContextMenu(sender.page);
});
port.on("composer.openDialog", (message, sender) =>
{
return new Promise(resolve =>
{
ext.windows.create({
- url: chrome.extension.getURL("composer.html"),
+ url: browser.extension.getURL("composer.html"),
left: 50,
top: 50,
width: 420,
height: 200,
type: "popup"
},
popupPage =>
{
« no previous file with comments | « lib/devtools.js ('k') | lib/filterValidation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld