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

Unified Diff: firstRun.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 | « no previous file | js/desktop-options.js » ('j') | messageResponder.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firstRun.js
===================================================================
--- a/firstRun.js
+++ b/firstRun.js
@@ -70,14 +70,17 @@
updateSocialLinks();
- ext.onMessage.addListener((message) =>
+ let port = browser.runtime.connect({name: "ui"});
+
+ port.onMessage.addListener((message) =>
{
if (message.type == "subscriptions.respond")
{
updateSocialLinks();
}
});
- browser.runtime.sendMessage({
+
+ port.postMessage({
type: "subscriptions.listen",
filter: ["added", "removed", "updated", "disabled"]
});
« no previous file with comments | « no previous file | js/desktop-options.js » ('j') | messageResponder.js » ('J')

Powered by Google App Engine
This is Rietveld