sender.url is undefined when tabs.sendMessage sends to an extension page
Reported by
natalie....@gmail.com,
Jul 10 2016
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0 Steps to reproduce the problem: 1. Log the `sender.url` in a content script `runtime.onMessage` listener. 2. Send a message from the background page to a tab with `runtime.sendMessage`. 3. Check the log - `sender.url` is `undefined`. What is the expected behavior? `sender.url` should be the background page's `document.documentURI`. What went wrong? `sender.url` is `undefined`, not the background page URL. Did this work before? N/A Chrome version: 51.0.2704.79 Channel: stable OS Version: Flash Version: When a tab contains an extension page one can't assume that the background page is the message sender - any extension page could have sent it. Thus, the `sender.url` should be set in `tabs.sendMessage` as it is in `runtime.sendMessage`. Components: Platform>Extensions>API
,
Jul 13 2016
The attached extension opens an extension page, which immediately sends a message to the background page. The background page responds by sending two messages, one with `tabs.sendMessage` and one with `runtime.sendMessage`. Each page logs MessageSender.url and MessageSender.tab.id (formatted as "<url>#<tabId>") and the message to the console. You'll see in the extension page's log that MessageSender.url is a URL string for messages sent with `runtime.sendMessage` but is `undefined` for messages sent with `tabs.sendMessage`. It should be URL string in both cases. Thank you.
,
Jul 13 2016
Oh, the extension page is listed as the options page in the manifest, but any extension page will act the same way.
,
Jul 13 2016
Thank you for providing more feedback. Adding requester "durga.behera@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 15 2016
Able to reproduce the issue on Ubuntu 14.04,Win 7 and Mac 10.11.5 using latest stable 51.0.2704.106 and canary 54.0.2797.0. This is a non-regression issue since 30.0.1557.0(prior to 35 versions this extension is going to infinite loop).
,
Jul 15 2016
I'll have a look at this since I've been investigating some related code recently.
,
Jul 15 2016
I don't see how this has to do with notifications, removing the label.
,
Jul 15 2016
Ok, I can confirm that for messages sent via chrome.tabs.sendMessage, we do not include an url, but for ones that are sent via chrome.runtime.sendMessage, we do.
,
May 15 2018
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by durga.behera@chromium.org
, Jul 11 2016Labels: Needs-Feedback M-51