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

Unified Diff: messageResponder.js

Issue 29488575: Issue 5384 - Introduced dedicated mobile options page (Closed)
Patch Set: Added ID constants Created Aug. 28, 2017, 2:51 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 | « locale/en-US/mobile-options.json ('k') | mobile-options.html » ('j') | 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
@@ -36,9 +36,11 @@
const {Synchronizer} = require("synchronizer");
const info = require("info");
- const {Subscription,
- DownloadableSubscription,
- SpecialSubscription} = require("subscriptionClasses");
+ const {
+ Subscription,
+ DownloadableSubscription,
+ SpecialSubscription
+ } = require("subscriptionClasses");
// Some modules doesn't exist on Firefox. Moreover,
// require() throws an exception on Firefox in that case.
@@ -197,7 +199,15 @@
port.on("app.open", (message, sender) =>
{
if (message.what == "options")
- ext.showOptions();
+ {
+ ext.showOptions(() =>
+ {
+ if (!message.action)
+ return;
+
+ sendMessage("app", message.action, ...message.args);
+ });
+ }
});
port.on("filters.add", (message, sender) =>
@@ -228,9 +238,9 @@
let filters = [];
const {checkWhitelisted} = require("whitelisting");
- if (Prefs.enabled && !checkWhitelisted(sender.page, sender.frame,
- RegExpFilter.typeMap.DOCUMENT |
- RegExpFilter.typeMap.ELEMHIDE))
+ let isWhitelisted = checkWhitelisted(sender.page, sender.frame,
+ RegExpFilter.typeMap.DOCUMENT | RegExpFilter.typeMap.ELEMHIDE);
+ if (Prefs.enabled && !isWhitelisted)
{
let {hostname} = sender.frame.url;
filters = ElemHideEmulation.getRulesForDomain(hostname);
« no previous file with comments | « locale/en-US/mobile-options.json ('k') | mobile-options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld