Details
-
Bug
-
Resolution: Fixed
-
Medium
-
6.1.5
-
None
-
6.01
-
Description
I am getting JS errors on the view issue page when I have the Evernote Web Clipper extension installed in Chrome. After some investigation here is what I have determined:
There is this code in Gadgets (no idea why it's on the view issue page, but I digress):
function setupChannel() { if (relayChannel === "dpm" || relayChannel === "wpm") { window.addEventListener("message", function(packet) { process(gadgets.json.parse(packet.data)) }, false) } }
That is setting up an event listener for Window.postMessage events, presumably for communication between iframes. The problem is that it is assuming too much about what messages will be posted (this is a shared message bus, after all) and erroring out if the message looks different from what it expects.
In this case the Evernote Web Clipper is also using Window.postMessage but obviously its messages are not intended to be processed by Gadgets.
The gadgets code needs to be made robust:
- check the packet.origin or something to filter out messages it does not expect, and
- wrap a try/catch around the packet.data parsing.
Obviously this can happen for other browsers and other extensions too.
Attachments
Issue Links
- clones
-
JDEV-26840 Loading...