Fires when the active tab in a window changes. Note that the tab's URL may
not be set at the time this event fired, but you can listen to onUpdated
events so as to be notified when a URL is set.
Fires when the selected tab in a window changes. Note that the tab's URL
may not be set at the time this event fired, but you can listen to
tabs.onUpdated events so as to be notified when a URL is set.
Fired when a tab is created. Note that the tab's URL and tab group
membership may not be set at the time this event is fired, but you can
listen to onUpdated events so as to be notified when a URL is set or the
tab is added to a tab group.
Fired when a tab is moved within a window. Only one move event is fired,
representing the tab the user directly moved. Move events are not fired
for the other tabs that must move in response to the manually-moved tab.
This event is not fired when a tab is moved between windows; for details,
see tabs.onDetached.
Captures the visible area of the currently active tab in the specified
window. In order to call this method, the extension must have either the
<all_urls> permission
or the activeTab permission. In addition to
sites that extensions can normally access, this method allows extensions
to capture sensitive sites that are otherwise restricted, including
chrome:-scheme pages, other extensions' pages, and data: URLs. These
sensitive sites can only be captured with the activeTab permission. File
URLs may be captured only if the extension has been granted file access.
windowId The target window. Defaults to the current
window.
Connects to the content script(s) in the specified tab. The
runtime.onConnect event is fired in each content script running in the
specified tab for the current extension. For more details, see Content
Script Messaging.
returns A port that can be used to communicate with the content
scripts running in the specified tab. The port's runtime.Port event is
fired if the tab closes or does not exist.
Discards a tab from memory. Discarded tabs are still visible on the tab
strip and are reloaded when activated.
tabId The ID of the tab to be discarded. If specified, the tab is
discarded unless it is active or already discarded. If omitted, the
browser discards the least important tab. This can fail if no
discardable tabs exist.
returns Called after the operation is completed.
Injects JavaScript code into a page. For details, see the programmatic
injection section of the
content scripts doc.
tabId The ID of the tab in which to run the script; defaults to the
active tab of the current window.
details Details of the script to run. Either the code or the file
property must be set, but both may not be set at the same time.
returns Called after all the JavaScript has been executed.
Gets the tab that this script call is being made from. Returns undefined
if called from a non-tab context (for example, a background page or popup
view).
Gets the current zoom factor of a specified tab.
tabId The ID of the tab to get the current zoom factor from; defaults
to the active tab of the current window.
returns Called with the tab's current zoom factor after it has been
fetched.
Gets the current zoom settings of a specified tab.
tabId The ID of the tab to get the current zoom settings from;
defaults to the active tab of the current window.
returns Called with the tab's current zoom settings.
Injects CSS into a page. Styles inserted with this method can be removed
with scripting.removeCSS. For details, see the programmatic
injection section of the
content scripts doc.
tabId The ID of the tab in which to insert the CSS; defaults to the
active tab of the current window.
details Details of the CSS text to insert. Either the code or the file
property must be set, but both may not be set at the same time.
returns Called when all the CSS has been inserted.
Moves one or more tabs to a new position within its window, or to a new
window. Note that tabs can only be moved to and from normal (window.type
=== "normal") windows.
tabIds The tab ID or list of tab IDs to move.
Removes from a page CSS that was previously injected by a call to
scripting.insertCSS.
tabId The ID of the tab from which to remove the CSS; defaults to the
active tab of the current window.
details Details of the CSS text to remove. Either the code or the file
property must be set, but both may not be set at the same time.
returns Called when all the CSS has been removed.
Sends a single message to the content script(s) in the specified tab, with
an optional callback to run when a response is sent back. The
runtime.onMessage event is fired in each content script running in the
specified tab for the current extension.
message The message to send. This message should be a JSON-ifiable
object.
Sends a single request to the content script(s) in the specified tab, with
an optional callback to run when a response is sent back. The
extension.onRequest event is fired in each content script running in the
specified tab for the current extension.
Zooms a specified tab.
tabId The ID of the tab to zoom; defaults to the active tab of the
current window.
zoomFactor The new zoom factor. A value of 0 sets the tab to its
current default zoom factor. Values greater than 0 specify a (possibly
non-default) zoom factor for the tab.
returns Called after the zoom factor has been changed.
Sets the zoom settings for a specified tab, which define how zoom changes
are handled. These settings are reset to defaults upon navigating the tab.
tabId The ID of the tab to change the zoom settings for; defaults to
the active tab of the current window.
zoomSettings Defines how zoom changes are handled and at what scope.
returns Called after the zoom settings are changed.
Removes one or more tabs from their respective groups. If any groups
become empty, they are deleted.
tabIds The tab ID or list of tab IDs to remove from their respective
groups.
Modifies the properties of a tab. Properties that are not specified in
updateProperties are not modified.
tabId Defaults to the selected tab of the current
window.