Left: | ||
Right: |
OLD | NEW |
---|---|
1 "use strict"; | 1 "use strict"; |
2 | 2 |
3 // Firefox 55 erroneously sends messages from the content script to the | 3 // Firefox 55 erroneously sends messages from the content script to the |
4 // devtools panel: | 4 // devtools panel: |
5 // https://bugzilla.mozilla.org/show_bug.cgi?id=1383310 | 5 // https://bugzilla.mozilla.org/show_bug.cgi?id=1383310 |
6 // As a workaround, listen for messages only if this isn't the devtools panel. | 6 // As a workaround, listen for messages only if this isn't the devtools panel. |
7 if (!("devtools" in chrome)) | 7 if (!chrome.devtools) |
Manish Jethani
2017/08/30 10:38:44
Maybe add a comment about why chrome.devtools and
Wladimir Palant
2017/08/30 12:54:54
Done.
| |
8 { | 8 { |
9 // Listen for messages from the background page. | 9 // Listen for messages from the background page. |
10 chrome.runtime.onMessage.addListener((message, sender, sendResponse) => | 10 chrome.runtime.onMessage.addListener((message, sender, sendResponse) => |
11 { | 11 { |
12 return ext.onMessage._dispatch(message, {}, sendResponse).includes(true); | 12 return ext.onMessage._dispatch(message, {}, sendResponse).includes(true); |
13 }); | 13 }); |
14 } | 14 } |
15 | 15 |
16 (function() | 16 (function() |
17 { | 17 { |
(...skipping 17 matching lines...) Expand all Loading... | |
35 | 35 |
36 if (!port.onDisconnect.hasListeners()) | 36 if (!port.onDisconnect.hasListeners()) |
37 { | 37 { |
38 port.disconnect(); | 38 port.disconnect(); |
39 port = null; | 39 port = null; |
40 } | 40 } |
41 } | 41 } |
42 } | 42 } |
43 }; | 43 }; |
44 }()); | 44 }()); |
OLD | NEW |