Search e01
One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.
6 results across 6 corpora for tabs.onUpdated.
Developer library 6
Work with the Bookmarks API
or window. These actions could change the viewed URL and therefore the status of the extension's toolbar icon. ```js // listen to tab URL changes browser.tabs.onUpdated.addListener(updateActiveTab); // listen to tab switching browser.tabs.onActivated.addListener(updateActiveTab); // listen for window switching browser.windows.onFocusChanged.addListener(updateActiveTab); ``` ## Learn more If you want to learn mor
Background scripts
ersisted, and will not restart the event page. browser.bookmarks.onCreated.addListener(() => { // do something }); }; ``` Do this: ```js browser.tabs.onUpdated.addListener(() => { // This event is run in the top level scope of the event page, and will persist, allowing // it to restart the event page if necessary. }); ``` Extensions can remove listeners from their background scripts by calling `removeL
tabGroups
.onMoved - : Fires when a tab group is moved within a window or to another window. - tabGroups.onRemoved - : Fires when a tab group is removed. - tabGroups.onUpdated - : Fires when a tab group is updated. h2 ## Browser compatibility ## See also - tabs.group() - tabs.ungroup() - tabs.query() - tabs.Tab
tabGroups.onUpdated
when a tab group's state changes. This event does not fire when the group's membership changes or when a tab group is moved. Those updates are covered by tabs.onUpdated and tabGroups.onMoved respectively. To detect `windowId` changes, use tabGroups.onMoved instead. ## Syntax ```js-nolint browser.tabGroups.onUpdated.addListener(listener) browser.tabGroups.onUpdated.removeListener(listener) browser.tabGroups.onUpda
pageAction.setTitle()
e_action) manifest key. ## Examples Whenever a tab is updated, show the page action for that tab, and set its title to show the tab's ID: ```js browser.tabs.onUpdated.addListener((tabId, changeInfo, tabInfo) => { browser.pageAction.show(tabId); browser.pageAction.setTitle({ tabId, title: `Tab ID: ${tabId}`, }); }); ``` ## Browser compatibility > [!NOTE] > This API is based on Chromium's [`chrom
pageAction.setPopup()
the popup that was specified in the [`page_action`](/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action) manifest key. ## Examples Listen for tabs.onUpdated events, and switch the popup if the loading status changes: ```js browser.tabs.onUpdated.addListener((tabId, changeInfo, tabInfo) => { if (changeInfo.status) { browser.pageAction.show(tabId); if (changeInfo.status === "loading") { br