unhandledrejection event isn't fired in extension content scripts
Reported by
co...@streak.com,
Jan 13 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36 Steps to reproduce the problem: 1. Install the attached extension. 2. Navigate to http://www.example.com/ 3. Check the devtools console. What is the expected behavior? The following should be in the console: [Content script] got the event: [Content script] rejection test at setTimeout (extension.js:9) [Page] got the event: Error: [Page] rejection test at setTimeout (<anonymous>:10:18) What went wrong? The following appears in the console: Uncaught (in promise) Error: [Content script] rejection test at setTimeout (extension.js:9) [Page] got the event: Error: [Page] rejection test at setTimeout (<anonymous>:10:18) The first message is from Chrome itself; the extension's registered event handler was never called. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 55.0.2883.95 Channel: stable OS Version: OS X 10.11.4 Flash Version: Shockwave Flash 24.0 r0 The extension adds an event handler for unhandledrejection to window which console.logs all events, and then it triggers an unhandled Promise rejection. The event handler should get called but it never does. The extension then injects similar code into the page's isolated world just for comparison to show how things should work. This is possibly related to the bug that extension content script "error" events are censored: https://bugs.chromium.org/p/chromium/issues/detail?id=457785
,
Jan 16 2017
,
Jan 18 2017
Able to reproduce the issue on Mac 10.12.2, Win 10 and Ubuntu 14.04 using 55.0.2883.95/87 and canary 57.0.2984.0. This is a non-regression issue seen from 45.0.2454.101 and prior to it seeing error in console as "Uncaught SyntaxError: missing ) after argument list"/44.0.2403.157 and "Uncaught SyntaxError: Unexpected token =>"/43.0.2357.18. Untriaged the issue so as to get addressed further.
,
Jan 18 2017
Oh yeah I used some ES6 arrow function syntax in the example. I think Chrome didn't add unhandledrejection events until after arrow functions were added, so hopefully it doesn't confuse testing of old versions too much. |
|||
►
Sign in to add a comment |
|||
Comment 1 by shrike@chromium.org
, Jan 14 2017