GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

Search e01

One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.

7 results across 6 corpora for runtime.onConnect.

Papers 1

Developer library 6

Background scripts

Disconnect` lets you discover when open ports are closing, however the listener is under the same time constraints as runtime.onSuspend. ```js browser.runtime.onConnect.addListener((port) => { port.onMessage.addListener((message) => { if (message === "hello") { let response = { greeting: "welcome!" }; port.postMessage(response); } else if (message === "goodbye") { console.log("Disconnecti

Extend the developer tools

o exchange messages between the content scripts running in the target window and a devtools document, it's a good idea to use the runtime.connect() and runtime.onConnect to set up a connection between the background page and the devtools document. The background page can then maintain a mapping between tab IDs and runtime.Port objects, and use this to route messages between the two scopes. ![The background page tab

Work with documentId

ead the `documentId` from webRequest event details. - Read the `documentId` from runtime.MessageSender when receiving messages using runtime.onMessage, runtime.onConnect, and related listeners. - Read the `documentId` from the results of runtime.getContexts(). ## Using documentId to target documents When you have a `documentId`, you can use it to target that document: - **Script and CSS injection**: Use `documentI

tabs.connect()

ent_scripts) that belong to this extension and are running in the specified tab. This function returns a runtime.Port object. When this is called, the runtime.onConnect event will be fired in any content script belonging to this extension that are running in the specified tab. The event listener will be passed another runtime.Port object. The two sides can then use the `Port` objects to exchange messages. For more

runtime

owserUpdateAvailable - : Fired when an update for the browser is available, but isn't installed immediately because a browser restart is required. - runtime.onConnect - : Fired when a connection is made with either an extension process or a content script. - runtime.onConnectExternal - : Fired when a connection is made with another extension. - runtime.onUserScriptConnect - : Fired when a connection is made

runtime.MessageSender

formation about the sender of a message or connection request that is passed to the runtime.onMessage() listener. Available for: - connections in the runtime.onConnect, runtime.onConnectExternal, and runtime.onUserScriptConnect listeners. In the runtime.onConnect() and runtime.onConnectExternal() listeners, it's a property of the `port` argument (runtime.Port). - messages in runtime.onMessage, runtime.onMessageExte

JSON results · Services directory