Uncaught TypeError in sendMessageImpl in extensions::messaging
Reported by
teo8...@gmail.com,
Mar 19 2016
|
||||
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36
Steps to reproduce the problem:
This is not systematically reproducible, but the code that triggers the error is:
var message={
type: 'activeTab',
active: !document.hidden,
};
chrome.runtime.sendMessage(message, function(response) {
// do nothing
});
What is the expected behavior?
I can't think of any scenario where the above code could fail at all for any valid reason.
However, if it does, the error should have a meaningful message and the very first element in the stack trace should be a line in MY code (or in any third party library I may be using).
What went wrong?
I occasionally observe the stack trace you can see in the attached screenshot.
An UNCAUGHT error inside Chrome's internal code is by definition a bug, regardless of whether it is triggered by something wrong in my code.
Note also that the stack trace points to lines in code that I cannot inspect, such as "extensions::messaging:326". If I click on that, I get the message you get when trying to open a link with an unknown scheme.
Did this work before? N/A
Chrome version: 49.0.2623.87 Channel: stable
OS Version:
Flash Version: Shockwave Flash 21.0 r0
,
Mar 21 2016
LOL obviously you have to test that from the content script of an extension.
,
Mar 23 2016
> I can't think of any scenario where the above code could fail at all for any valid reason. I do! When an extension is reloaded, the runtime is torn down and seemingly non-sensical things start to happen: from APIs returning the undefined value, to callbacks that are never called (or APIs that disappear, e.g. chrome.app and chrome.i18n, in content scripts). Or in this case, an obscure error being thrown. I can reproduce the issue as follows: 1. Open any webpage where an extension has a content script (e.g. visit example.com after installing an adblocking extension). 2. Reload the extension at chrome://extensions (causing the content script to be invalidated). 3. Switch the console's execution environment to the extension, and run chrome.runtime.sendMessage('anything'); Expected: - No error, or some non-obscure error. Actual: - Uncaught TypeError: Cannot read property 'name' of undefined Devlin: Should this quirk be fixed, and if so, how?
,
Jun 24 2016
I'm adding the GoodFirstBug label since it *might* be fairly straightforward to do something like send an ipc to the content scripts letting them know to tear down any open channels, and from then on return a sensible error message.
,
Jun 26 2017
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
||||
►
Sign in to add a comment |
||||
Comment 1 by ssamanoori@chromium.org
, Mar 21 2016248 KB
248 KB View Download