Issue metadata
Sign in to add a comment
|
After update of Chrome OS v56 to v57 chrome.runtime.sendMessage not working anymore between js scripts in the same html page |
||||||||||||||||||||
Issue description
Chrome Version: 57.0.2987.146
OS: ChromeOS
What steps will reproduce the problem?
(1) Update from 56.0.2924.110 to 57.0.2987.146
(2) Run device in kiosk mode
(3) Kiosk app fails to load properly
What is the expected result? Chrome kiosk app runs correctly and loads all apps needed in multiple app kiosk mode
What happens instead? Chrome kiosk app fails to run correctly since message passing does not work correctly
Since we upgraded chrome OS to version 57, specifically 57.0.2987.146 our Chrome Kiosk App doesn't start anymore.
The upgrade is done for some Chromeboxes in a test environment. Production is still on version 56 without any problems.
It looks like a problem in the chrome.runtime.sendMessage and chrome.runtime.onMessage.addListener API's
We use the API like this:
chrome.runtime.sendMessage({action: "saveInitConfig"});
When inspecting the chrome.runtime.lastError I see the message "Could not establish connection. Receiving end does not exist."
When I read the documentation for chrome.runtime.sendMessage https://developer.chrome.com/extensions/runtime#method-sendMessage it states:
Parameters
string (optional)extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging.
From this parameter documentation I conclude that if I omit the extensionId the message will be delivered to my own app.
Why is it that this problem occurs when going from Chrome OS 56 to 57?
Is the documentation outdated from now on?
Affected username(s) and device serial numbers: all
Exact text of any error messages: "Could not establish connection. Receiving end does not exist."
,
Apr 22 2017
,
Apr 22 2017
Is there a link to the app in question? Does this reproduce in regular user session, or is it kiosk only? Does sendMessage work if the callback is set, or if the target extension ID is set (to chrome.runtime.id)?
,
Apr 22 2017
Actually, it seems this is now expected in the same html page - https://bugs.chromium.org/p/chromium/issues/detail?id=677692
,
Apr 24 2017
If this is now intended behavior, should we update the documentation outlined for developers which states the following (which now looks to be inaccurate)? https://developer.chrome.com/extensions/runtime#method-sendMessage "If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging."
,
Apr 24 2017
That's still accurate, but maybe incomplete - omitting extension ID will still send the message to the app, but it won't work when sending the message to the same page (e.g. sending the message from app window to background page should still work). +rdevlin.cronin@chromium.org to confirm that disabling runtime.sendMessage within the same page was intentional.
,
Apr 25 2017
@6 runtime.sendMessage will not be sent to the same *frame* (if there are different frames within the same page, it will be sent to other frames). This is documented at the same link you provided: "If sending to your extension, the runtime.onMessage event will be fired in every frame of your extension (except for the sender's frame)," https://developer.chrome.com/extensions/runtime#method-sendMessage |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by sduraisamy@chromium.org
, Apr 22 2017Owner: tbarzic@chromium.org