You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could use browser.runtime.connect instead of browser.runtime.sendMessage to complete message delivery in xhr api.
The advantage of browser.runtime.connect is that it can maintain a long-lived connection between the object instance of the content scripts function and object instance of the background function. Since the message channel of the custom port name is exclusive, we no longer have to distinguish the source of the message, and the background will no longer need the xhrs global variable, all messages will be passed directly from object to object.
We could use
browser.runtime.connect
instead ofbrowser.runtime.sendMessage
to complete message delivery inxhr
api.The advantage of
browser.runtime.connect
is that it can maintain a long-lived connection between theobject instance of the content scripts function
andobject instance of the background function
. Since the message channel of the custom port name is exclusive, we no longer have to distinguish the source of the message, and the background will no longer need thexhrs
global variable, all messages will be passed directly from object to object.Ref: #315
The text was updated successfully, but these errors were encountered: