Fired when a profile that has this extension installed first starts up. This event is not fired when a private browsing/incognito profile is started, even if this extension is operating in 'split' incognito mode.
browser.runtime.onStartup.addListener(listener) browser.runtime.onStartup.removeListener(listener) browser.runtime.onStartup.hasListener(listener)
All events have three functions:
addListener(listener)
listener
to the calling event.removeListener(listener)
listener
argument is the listener to remove.hasListener(listener)
listener
is registered for the calling event. Returns true
if it is listening, false
otherwise.The only parameter is listener
, used for any of the above functions.
listener
A function that will be called when this event occurs.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
onStartup |
23 |
79 |
52 |
? |
15 |
14 |
? |
? |
52 |
? |
? |
? |
Open https://giphy.com/explore/cat when the browser starts up:
function handleStartup() { browser.tabs.create({ url: "https://giphy.com/explore/cat" }); } browser.runtime.onStartup.addListener(handleStartup);
Note: This API is based on Chromium's chrome.runtime
API. This documentation is derived from runtime.json
in the Chromium code.
Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onStartup