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: Use less generic name for only listener argument we care about Created March 7, 2018, 2:01 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"});
saroyanm 2018/03/07 17:49:44 We probably need to update the Mock polyfill as we
Thomas Greiner 2018/03/07 19:19:39 Done. Since the issue doesn't occur in the test en
+
+ 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