`chrome.runtime.connect()`: documentation is not clear
Reported by
vitaly.z...@gmail.com,
Aug 2 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36 Steps to reproduce the problem: 1. Open https://developer.chrome.com/extensions/runtime#method-connect 2. Read description. 3. How do you think - is description clear enough? What is the expected behavior? Use cases in description. What went wrong? I do not understand - why I need to make some `connect` if I already can send massages from content script to event page and from event page to popup and from popup to event page? Did this work before? N/A Does this work in other browsers? Yes Chrome version: 60.0.3112.78 Channel: stable OS Version: OS X 10.12.6 Flash Version:
,
Aug 2 2017
On the other hand, it might be a good idea to add a link to https://developer.chrome.com/extensions/messaging in each messaging-related method in the reference.
,
Aug 2 2017
As I understand long-lived connection will work faster than the opening of port for every message?
,
Aug 2 2017
But if I have an event page and popup page maybe it is not much sense to use long-lived connection because popup will be closed (killed) on next second and event page will die after few seconds?
,
Aug 2 2017
The actual difference in performance is usually negligible unless you send hundreds of messages per second. Also, if it's between the popup and the background page, it might be better to access the background page directly via chrome.runtime.getBackgroundPage() The event page will not unload until all visible views (for example, popup windows) are closed and all message ports are closed. In other words, no connection to the event page can outlive the event page itself. It's connected only while it runs. Normally, long-lived port connections aren't really needed, but there are some cases when this is the only method (e.g. communicating with a content script that's loaded in a web iframe inside the background page), or when this is a preferred method for page-to-page communication (to avoid broadcasting into all open internal extension pages such as open popups, option pages, background page, etc.), or when you want to detect the moment the other connected context was unloaded (e.g. a content script can detect if the entire extension was reloaded on chrome://extensions page or upgraded/uninstalled).
,
Aug 3 2017
Could anyone from extension team look in to this issue? Thanks!
,
Oct 17 2017
Seems it is out of scope from TE end, adding TE-NeedsTraige-help label to move this out of our triaging bucket. Could someone from dev team please take a look into this issue. Thanks..!
,
Aug 30
|
||||
►
Sign in to add a comment |
||||
Comment 1 by woxxom@gmail.com
, Aug 2 2017