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

Unified Diff: messageResponder.js

Issue 29564735: Issue 5587 - Use options module (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Created Oct. 4, 2017, 9:13 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
« ext/background.js ('K') | « ext/background.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: messageResponder.js
===================================================================
--- a/messageResponder.js
+++ b/messageResponder.js
@@ -34,16 +34,18 @@
const info = require("info");
const {
Subscription,
DownloadableSubscription,
SpecialSubscription
} = require("subscriptionClasses");
+ const {showOptions} = require("options");
+
port.on("types.get", (message, sender) =>
{
let filterTypes = Array.from(require("requestBlocker").filterTypes);
filterTypes.push(...filterTypes.splice(filterTypes.indexOf("OTHER"), 1));
return filterTypes;
});
function convertObject(keys, obj)
@@ -207,17 +209,17 @@
{
getListenerFilters(sender.page).app = message.filter;
});
port.on("app.open", (message, sender) =>
{
if (message.what == "options")
{
- ext.showOptions(() =>
+ showOptions(() =>
{
if (!message.action)
return;
sendMessage("app", message.action, ...message.args);
});
}
});
@@ -347,17 +349,17 @@
let subscription = Subscription.fromURL(message.url);
if (message.confirm)
{
if ("title" in message)
subscription.title = message.title;
if ("homepage" in message)
subscription.homepage = message.homepage;
- ext.showOptions(() =>
+ showOptions(() =>
{
sendMessage("app", "addSubscription", subscription);
});
}
else
{
addSubscription(subscription, message);
}
« ext/background.js ('K') | « ext/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld