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

Side by Side Diff: chrome/ext/content.js

Issue 29374674: Issue 4864 - Start using ESLint for adblockpluschrome (Closed)
Patch Set: Addressed more feedback Created March 31, 2017, 8:23 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/ext/common.js ('k') | chrome/ext/devtools.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 "use strict"; 1 "use strict";
2 2
3 chrome.runtime.onMessage.addListener((message, sender, sendResponse) => 3 chrome.runtime.onMessage.addListener((message, sender, sendResponse) =>
4 { 4 {
5 return ext.onMessage._dispatch(message, {}, sendResponse).indexOf(true) != -1; 5 return ext.onMessage._dispatch(message, {}, sendResponse).indexOf(true) != -1;
6 }); 6 });
7 7
8 (function()
8 { 9 {
9 let port = null; 10 let port = null;
10 11
11 ext.onExtensionUnloaded = { 12 ext.onExtensionUnloaded = {
12 addListener(listener) 13 addListener(listener)
13 { 14 {
14 if (!port) 15 if (!port)
15 port = chrome.runtime.connect(); 16 port = chrome.runtime.connect();
16 17
17 // When the extension is reloaded, disabled or uninstalled the 18 // When the extension is reloaded, disabled or uninstalled the
18 // background page dies and automatically disconnects all ports 19 // background page dies and automatically disconnects all ports
19 port.onDisconnect.addListener(listener); 20 port.onDisconnect.addListener(listener);
20 }, 21 },
21 removeListener(listener) 22 removeListener(listener)
22 { 23 {
23 if (port) 24 if (port)
24 { 25 {
25 port.onDisconnect.removeListener(listener); 26 port.onDisconnect.removeListener(listener);
26 27
27 if (!port.onDisconnect.hasListeners()) 28 if (!port.onDisconnect.hasListeners())
28 { 29 {
29 port.disconnect(); 30 port.disconnect();
30 port = null; 31 port = null;
31 } 32 }
32 } 33 }
33 } 34 }
34 }; 35 };
35 } 36 }());
OLDNEW
« no previous file with comments | « chrome/ext/common.js ('k') | chrome/ext/devtools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld