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

Unified Diff: js/desktop-options.js

Issue 29715759: Issue 6440 - Use long-lived connections to listen to extension events (Closed)
Patch Set: Created March 6, 2018, 6:35 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 | « firstRun.js ('k') | messageResponder.js » ('j') | messageResponder.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: js/desktop-options.js
===================================================================
--- a/js/desktop-options.js
+++ b/js/desktop-options.js
@@ -1419,7 +1419,9 @@
}
}
-ext.onMessage.addListener((message) =>
+let port = browser.runtime.connect({name: "ui"});
+
+port.onMessage.addListener((message) =>
{
switch (message.type)
{
@@ -1450,21 +1452,21 @@
}
});
-browser.runtime.sendMessage({
+port.postMessage({
type: "app.listen",
filter: ["addSubscription", "focusSection"]
});
-browser.runtime.sendMessage({
+port.postMessage({
type: "filters.listen",
filter: ["added", "loaded", "removed"]
});
-browser.runtime.sendMessage({
+port.postMessage({
type: "prefs.listen",
filter: ["notifications_ignoredcategories", "notifications_showui",
"show_devtools_panel", "shouldShowBlockElementMenu",
"ui_warn_tracking"]
});
-browser.runtime.sendMessage({
+port.postMessage({
type: "subscriptions.listen",
filter: ["added", "disabled", "homepage", "lastDownload", "removed",
"title", "downloadStatus", "downloading"]
« no previous file with comments | « firstRun.js ('k') | messageResponder.js » ('j') | messageResponder.js » ('J')

Powered by Google App Engine
This is Rietveld