OLD | NEW |
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 !("tab" in sender) && |
| 6 ext.onMessage._dispatch(message, {}, sendResponse).indexOf(true) != -1; |
6 }); | 7 }); |
7 | 8 |
8 (function() | 9 (function() |
9 { | 10 { |
10 let port = null; | 11 let port = null; |
11 | 12 |
12 ext.onExtensionUnloaded = { | 13 ext.onExtensionUnloaded = { |
13 addListener(listener) | 14 addListener(listener) |
14 { | 15 { |
15 if (!port) | 16 if (!port) |
(...skipping 11 matching lines...) Expand all Loading... |
27 | 28 |
28 if (!port.onDisconnect.hasListeners()) | 29 if (!port.onDisconnect.hasListeners()) |
29 { | 30 { |
30 port.disconnect(); | 31 port.disconnect(); |
31 port = null; | 32 port = null; |
32 } | 33 } |
33 } | 34 } |
34 } | 35 } |
35 }; | 36 }; |
36 }()); | 37 }()); |
OLD | NEW |