Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.
Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser. * available since Chrome 36 * https://developer.chrome.com/apps/tabs
(capture-visible-tab)
(capture-visible-tab window-id)
(capture-visible-tab window-id options)
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.
|window-id| - The target window. Defaults to the current window. |options| - Details about the format and quality of an image.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [data-url] where:
|data-url| - A data URL that encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML img element for display.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/tabs#method-captureVisibleTab.
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. |window-id| - The target window. Defaults to the current window. |options| - Details about the format and quality of an image. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [data-url] where: |data-url| - A data URL that encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML img element for display. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-captureVisibleTab.
(connect tab-id)
(connect tab-id connect-info)
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.
|tab-id| - https://developer.chrome.com/apps/tabs#property-connect-tabId. |connect-info| - https://developer.chrome.com/apps/tabs#property-connect-connectInfo.
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. |tab-id| - https://developer.chrome.com/apps/tabs#property-connect-tabId. |connect-info| - https://developer.chrome.com/apps/tabs#property-connect-connectInfo. https://developer.chrome.com/apps/tabs#method-connect.
(create create-properties)
Creates a new tab.
|create-properties| - https://developer.chrome.com/apps/tabs#property-create-createProperties.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [tab] where:
|tab| - The created tab.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Creates a new tab. |create-properties| - https://developer.chrome.com/apps/tabs#property-create-createProperties. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [tab] where: |tab| - The created tab. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-create.
(detect-language)
(detect-language tab-id)
Detects the primary language of the content in a tab.
|tab-id| - Defaults to the active tab of the current window.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [language] where:
|language| - An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The second to fourth columns are checked and the first non-NULL value is returned, except for Simplified Chinese for which zh-CN is returned. For an unknown/undefined language, und is returned.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/tabs#method-detectLanguage.
Detects the primary language of the content in a tab. |tab-id| - Defaults to the active tab of the current window. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [language] where: |language| - An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The second to fourth columns are checked and the first non-NULL value is returned, except for Simplified Chinese for which zh-CN is returned. For an unknown/undefined language, und is returned. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-detectLanguage.
(discard)
(discard tab-id)
Discards a tab from memory. Discarded tabs are still visible on the tab strip and are reloaded when activated.
|tab-id| - 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.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [tab] where:
|tab| - The discarded tab, if it was successfully discarded; undefined otherwise.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Discards a tab from memory. Discarded tabs are still visible on the tab strip and are reloaded when activated. |tab-id| - 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. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [tab] where: |tab| - The discarded tab, if it was successfully discarded; undefined otherwise. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-discard.
(duplicate tab-id)
Duplicates a tab.
|tab-id| - The ID of the tab to duplicate.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [tab] where:
|tab| - Details about the duplicated tab. The 'tabs.Tab' object does not contain url, pendingUrl, title, and favIconUrl if the 'tabs' permission has not been requested.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Duplicates a tab. |tab-id| - The ID of the tab to duplicate. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [tab] where: |tab| - Details about the duplicated tab. The 'tabs.Tab' object does not contain url, pendingUrl, title, and favIconUrl if the 'tabs' permission has not been requested. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-duplicate.
(execute-script tab-id details)
Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
|tab-id| - 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.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - The result of the script in every injected frame.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/tabs#method-executeScript.
Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. |tab-id| - 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. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - The result of the script in every injected frame. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-executeScript.
(get tab-id)
Retrieves details about the specified tab.
|tab-id| - https://developer.chrome.com/apps/tabs#property-get-tabId.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [tab] where:
|tab| - https://developer.chrome.com/apps/tabs#property-callback-tab.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Retrieves details about the specified tab. |tab-id| - https://developer.chrome.com/apps/tabs#property-get-tabId. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [tab] where: |tab| - https://developer.chrome.com/apps/tabs#property-callback-tab. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-get.
(get-all-in-window)
(get-all-in-window window-id)
Gets details about all tabs in the specified window.
|window-id| - Defaults to the current window.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [tabs] where:
|tabs| - https://developer.chrome.com/apps/tabs#property-callback-tabs.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/tabs#method-getAllInWindow.
Gets details about all tabs in the specified window. |window-id| - Defaults to the current window. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [tabs] where: |tabs| - https://developer.chrome.com/apps/tabs#property-callback-tabs. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-getAllInWindow.
(get-current)
Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example, a background page or popup view).
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [tab] where:
|tab| - https://developer.chrome.com/apps/tabs#property-callback-tab.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example, a background page or popup view). This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [tab] where: |tab| - https://developer.chrome.com/apps/tabs#property-callback-tab. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-getCurrent.
(get-selected)
(get-selected window-id)
Gets the tab that is selected in the specified window.
|window-id| - Defaults to the current window.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [tab] where:
|tab| - https://developer.chrome.com/apps/tabs#property-callback-tab.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Gets the tab that is selected in the specified window. |window-id| - Defaults to the current window. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [tab] where: |tab| - https://developer.chrome.com/apps/tabs#property-callback-tab. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-getSelected.
(get-tab-id-none)
An ID that represents the absence of a browser tab.
https://developer.chrome.com/apps/tabs#property-TAB_ID_NONE.
An ID that represents the absence of a browser tab. https://developer.chrome.com/apps/tabs#property-TAB_ID_NONE.
(get-zoom)
(get-zoom tab-id)
Gets the current zoom factor of a specified tab.
|tab-id| - The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [zoom-factor] where:
|zoom-factor| - The tab's current zoom factor.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Gets the current zoom factor of a specified tab. |tab-id| - The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [zoom-factor] where: |zoom-factor| - The tab's current zoom factor. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-getZoom.
(get-zoom-settings)
(get-zoom-settings tab-id)
Gets the current zoom settings of a specified tab.
|tab-id| - The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [zoom-settings] where:
|zoom-settings| - The tab's current zoom settings.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/tabs#method-getZoomSettings.
Gets the current zoom settings of a specified tab. |tab-id| - The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [zoom-settings] where: |zoom-settings| - The tab's current zoom settings. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-getZoomSettings.
(go-back)
(go-back tab-id)
Go back to the previous page, if one is available.
|tab-id| - The ID of the tab to navigate back; defaults to the selected tab of the current window.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Go back to the previous page, if one is available. |tab-id| - The ID of the tab to navigate back; defaults to the selected tab of the current window. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-goBack.
(go-forward)
(go-forward tab-id)
Go foward to the next page, if one is available.
|tab-id| - The ID of the tab to navigate forward; defaults to the selected tab of the current window.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Go foward to the next page, if one is available. |tab-id| - The ID of the tab to navigate forward; defaults to the selected tab of the current window. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-goForward.
(group options)
Adds one or more tabs to a specified group, or if no group is specified, adds the given tabs to a newly created group.
|options| - https://developer.chrome.com/apps/tabs#property-group-options.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [group-id] where:
|group-id| - The ID of the group that the tabs were added to.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Adds one or more tabs to a specified group, or if no group is specified, adds the given tabs to a newly created group. |options| - https://developer.chrome.com/apps/tabs#property-group-options. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [group-id] where: |group-id| - The ID of the group that the tabs were added to. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-group.
(highlight highlight-info)
Highlights the given tabs and focuses on the first of group. Will appear to do nothing if the specified tab is currently active.
|highlight-info| - https://developer.chrome.com/apps/tabs#property-highlight-highlightInfo.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [window] where:
|window| - Contains details about the window whose tabs were highlighted.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Highlights the given tabs and focuses on the first of group. Will appear to do nothing if the specified tab is currently active. |highlight-info| - https://developer.chrome.com/apps/tabs#property-highlight-highlightInfo. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [window] where: |window| - Contains details about the window whose tabs were highlighted. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-highlight.
(insert-css tab-id details)
Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
|tab-id| - 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.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc. |tab-id| - 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. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-insertCSS.
(move tab-ids move-properties)
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.
|tab-ids| - The tab ID or list of tab IDs to move. |move-properties| - https://developer.chrome.com/apps/tabs#property-move-moveProperties.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [tabs] where:
|tabs| - Details about the moved tabs.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
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. |tab-ids| - The tab ID or list of tab IDs to move. |move-properties| - https://developer.chrome.com/apps/tabs#property-move-moveProperties. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [tabs] where: |tabs| - Details about the moved tabs. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-move.
(query query-info)
Gets all tabs that have the specified properties, or all tabs if no properties are specified.
|query-info| - https://developer.chrome.com/apps/tabs#property-query-queryInfo.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [result] where:
|result| - https://developer.chrome.com/apps/tabs#property-callback-result.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Gets all tabs that have the specified properties, or all tabs if no properties are specified. |query-info| - https://developer.chrome.com/apps/tabs#property-query-queryInfo. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [result] where: |result| - https://developer.chrome.com/apps/tabs#property-callback-result. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-query.
(reload)
(reload tab-id)
(reload tab-id reload-properties)
Reload a tab.
|tab-id| - The ID of the tab to reload; defaults to the selected tab of the current window. |reload-properties| - https://developer.chrome.com/apps/tabs#property-reload-reloadProperties.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Reload a tab. |tab-id| - The ID of the tab to reload; defaults to the selected tab of the current window. |reload-properties| - https://developer.chrome.com/apps/tabs#property-reload-reloadProperties. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-reload.
(remove tab-ids)
Closes one or more tabs.
|tab-ids| - The tab ID or list of tab IDs to close.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Closes one or more tabs. |tab-ids| - The tab ID or list of tab IDs to close. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-remove.
(remove-css tab-id details)
Removes from a page CSS that was previously injected by a call to 'tabs.insertCSS'.
|tab-id| - 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.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Removes from a page CSS that was previously injected by a call to 'tabs.insertCSS'. |tab-id| - 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. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-removeCSS.
(send-message tab-id message)
(send-message tab-id message options)
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.
|tab-id| - https://developer.chrome.com/apps/tabs#property-sendMessage-tabId. |message| - The message to send. This message should be a JSON-ifiable object. |options| - https://developer.chrome.com/apps/tabs#property-sendMessage-options.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [response] where:
|response| - The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback is called with no arguments and 'runtime.lastError' is set to the error message.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
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. |tab-id| - https://developer.chrome.com/apps/tabs#property-sendMessage-tabId. |message| - The message to send. This message should be a JSON-ifiable object. |options| - https://developer.chrome.com/apps/tabs#property-sendMessage-options. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [response] where: |response| - The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback is called with no arguments and 'runtime.lastError' is set to the error message. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-sendMessage.
(send-request tab-id request)
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.
|tab-id| - https://developer.chrome.com/apps/tabs#property-sendRequest-tabId. |request| - https://developer.chrome.com/apps/tabs#property-sendRequest-request.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [response] where:
|response| - The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback is called with no arguments and 'runtime.lastError' is set to the error message.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
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. |tab-id| - https://developer.chrome.com/apps/tabs#property-sendRequest-tabId. |request| - https://developer.chrome.com/apps/tabs#property-sendRequest-request. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [response] where: |response| - The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback is called with no arguments and 'runtime.lastError' is set to the error message. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-sendRequest.
(set-zoom tab-id zoom-factor)
Zooms a specified tab.
|tab-id| - The ID of the tab to zoom; defaults to the active tab of the current window. |zoom-factor| - 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.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Zooms a specified tab. |tab-id| - The ID of the tab to zoom; defaults to the active tab of the current window. |zoom-factor| - 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. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-setZoom.
(set-zoom-settings tab-id zoom-settings)
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.
|tab-id| - The ID of the tab to change the zoom settings for; defaults to the active tab of the current window. |zoom-settings| - Defines how zoom changes are handled and at what scope.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/tabs#method-setZoomSettings.
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. |tab-id| - The ID of the tab to change the zoom settings for; defaults to the active tab of the current window. |zoom-settings| - Defines how zoom changes are handled and at what scope. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-setZoomSettings.
(tap-all-events chan)
Taps all valid non-deprecated events in chromex.app.tabs namespace.
Taps all valid non-deprecated events in chromex.app.tabs namespace.
(tap-on-activated-events channel & args)
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.
Events will be put on the |channel| with signature [::on-activated [active-info]] where:
|active-info| - https://developer.chrome.com/apps/tabs#property-onActivated-activeInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
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. Events will be put on the |channel| with signature [::on-activated [active-info]] where: |active-info| - https://developer.chrome.com/apps/tabs#property-onActivated-activeInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onActivated.
(tap-on-active-changed-events channel & args)
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.
Events will be put on the |channel| with signature [::on-active-changed [tab-id select-info]] where:
|tab-id| - The ID of the tab that has become active. |select-info| - https://developer.chrome.com/apps/tabs#property-onActiveChanged-selectInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/apps/tabs#event-onActiveChanged.
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. Events will be put on the |channel| with signature [::on-active-changed [tab-id select-info]] where: |tab-id| - The ID of the tab that has become active. |select-info| - https://developer.chrome.com/apps/tabs#property-onActiveChanged-selectInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onActiveChanged.
(tap-on-attached-events channel & args)
Fired when a tab is attached to a window; for example, because it was moved between windows.
Events will be put on the |channel| with signature [::on-attached [tab-id attach-info]] where:
|tab-id| - https://developer.chrome.com/apps/tabs#property-onAttached-tabId. |attach-info| - https://developer.chrome.com/apps/tabs#property-onAttached-attachInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when a tab is attached to a window; for example, because it was moved between windows. Events will be put on the |channel| with signature [::on-attached [tab-id attach-info]] where: |tab-id| - https://developer.chrome.com/apps/tabs#property-onAttached-tabId. |attach-info| - https://developer.chrome.com/apps/tabs#property-onAttached-attachInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onAttached.
(tap-on-created-events channel & args)
Fired when a tab is created. Note that the tab's URL 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.
Events will be put on the |channel| with signature [::on-created [tab]] where:
|tab| - Details of the tab that was created.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when a tab is created. Note that the tab's URL 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. Events will be put on the |channel| with signature [::on-created [tab]] where: |tab| - Details of the tab that was created. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onCreated.
(tap-on-detached-events channel & args)
Fired when a tab is detached from a window; for example, because it was moved between windows.
Events will be put on the |channel| with signature [::on-detached [tab-id detach-info]] where:
|tab-id| - https://developer.chrome.com/apps/tabs#property-onDetached-tabId. |detach-info| - https://developer.chrome.com/apps/tabs#property-onDetached-detachInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when a tab is detached from a window; for example, because it was moved between windows. Events will be put on the |channel| with signature [::on-detached [tab-id detach-info]] where: |tab-id| - https://developer.chrome.com/apps/tabs#property-onDetached-tabId. |detach-info| - https://developer.chrome.com/apps/tabs#property-onDetached-detachInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onDetached.
(tap-on-highlight-changed-events channel & args)
Fired when the highlighted or selected tabs in a window changes.
Events will be put on the |channel| with signature [::on-highlight-changed [select-info]] where:
|select-info| - https://developer.chrome.com/apps/tabs#property-onHighlightChanged-selectInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/apps/tabs#event-onHighlightChanged.
Fired when the highlighted or selected tabs in a window changes. Events will be put on the |channel| with signature [::on-highlight-changed [select-info]] where: |select-info| - https://developer.chrome.com/apps/tabs#property-onHighlightChanged-selectInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onHighlightChanged.
(tap-on-highlighted-events channel & args)
Fired when the highlighted or selected tabs in a window changes.
Events will be put on the |channel| with signature [::on-highlighted [highlight-info]] where:
|highlight-info| - https://developer.chrome.com/apps/tabs#property-onHighlighted-highlightInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when the highlighted or selected tabs in a window changes. Events will be put on the |channel| with signature [::on-highlighted [highlight-info]] where: |highlight-info| - https://developer.chrome.com/apps/tabs#property-onHighlighted-highlightInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onHighlighted.
(tap-on-moved-events channel & args)
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'.
Events will be put on the |channel| with signature [::on-moved [tab-id move-info]] where:
|tab-id| - https://developer.chrome.com/apps/tabs#property-onMoved-tabId. |move-info| - https://developer.chrome.com/apps/tabs#property-onMoved-moveInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
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'. Events will be put on the |channel| with signature [::on-moved [tab-id move-info]] where: |tab-id| - https://developer.chrome.com/apps/tabs#property-onMoved-tabId. |move-info| - https://developer.chrome.com/apps/tabs#property-onMoved-moveInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onMoved.
(tap-on-removed-events channel & args)
Fired when a tab is closed.
Events will be put on the |channel| with signature [::on-removed [tab-id remove-info]] where:
|tab-id| - https://developer.chrome.com/apps/tabs#property-onRemoved-tabId. |remove-info| - https://developer.chrome.com/apps/tabs#property-onRemoved-removeInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when a tab is closed. Events will be put on the |channel| with signature [::on-removed [tab-id remove-info]] where: |tab-id| - https://developer.chrome.com/apps/tabs#property-onRemoved-tabId. |remove-info| - https://developer.chrome.com/apps/tabs#property-onRemoved-removeInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onRemoved.
(tap-on-replaced-events channel & args)
Fired when a tab is replaced with another tab due to prerendering or instant.
Events will be put on the |channel| with signature [::on-replaced [added-tab-id removed-tab-id]] where:
|added-tab-id| - https://developer.chrome.com/apps/tabs#property-onReplaced-addedTabId. |removed-tab-id| - https://developer.chrome.com/apps/tabs#property-onReplaced-removedTabId.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when a tab is replaced with another tab due to prerendering or instant. Events will be put on the |channel| with signature [::on-replaced [added-tab-id removed-tab-id]] where: |added-tab-id| - https://developer.chrome.com/apps/tabs#property-onReplaced-addedTabId. |removed-tab-id| - https://developer.chrome.com/apps/tabs#property-onReplaced-removedTabId. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onReplaced.
(tap-on-selection-changed-events channel & args)
Fires when the selected tab in a window changes.
Events will be put on the |channel| with signature [::on-selection-changed [tab-id select-info]] where:
|tab-id| - The ID of the tab that has become active. |select-info| - https://developer.chrome.com/apps/tabs#property-onSelectionChanged-selectInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/apps/tabs#event-onSelectionChanged.
Fires when the selected tab in a window changes. Events will be put on the |channel| with signature [::on-selection-changed [tab-id select-info]] where: |tab-id| - The ID of the tab that has become active. |select-info| - https://developer.chrome.com/apps/tabs#property-onSelectionChanged-selectInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onSelectionChanged.
(tap-on-updated-events channel & args)
Fired when a tab is updated.
Events will be put on the |channel| with signature [::on-updated [tab-id change-info tab]] where:
|tab-id| - https://developer.chrome.com/apps/tabs#property-onUpdated-tabId. |change-info| - Lists the changes to the state of the tab that was updated. |tab| - Gives the state of the tab that was updated.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when a tab is updated. Events will be put on the |channel| with signature [::on-updated [tab-id change-info tab]] where: |tab-id| - https://developer.chrome.com/apps/tabs#property-onUpdated-tabId. |change-info| - Lists the changes to the state of the tab that was updated. |tab| - Gives the state of the tab that was updated. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onUpdated.
(tap-on-zoom-change-events channel & args)
Fired when a tab is zoomed.
Events will be put on the |channel| with signature [::on-zoom-change [zoom-change-info]] where:
|zoom-change-info| - https://developer.chrome.com/apps/tabs#property-onZoomChange-ZoomChangeInfo.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when a tab is zoomed. Events will be put on the |channel| with signature [::on-zoom-change [zoom-change-info]] where: |zoom-change-info| - https://developer.chrome.com/apps/tabs#property-onZoomChange-ZoomChangeInfo. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/tabs#event-onZoomChange.
(ungroup tab-ids)
Removes one or more tabs from their respective groups. If any groups become empty, they are deleted.
|tab-ids| - The tab ID or list of tab IDs to remove from their respective groups.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Removes one or more tabs from their respective groups. If any groups become empty, they are deleted. |tab-ids| - The tab ID or list of tab IDs to remove from their respective groups. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-ungroup.
(update tab-id update-properties)
Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
|tab-id| - Defaults to the selected tab of the current window. |update-properties| - https://developer.chrome.com/apps/tabs#property-update-updateProperties.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [tab] where:
|tab| - Details about the updated tab. The 'tabs.Tab' object does not contain url, pendingUrl, title, and favIconUrl if the 'tabs' permission has not been requested.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. |tab-id| - Defaults to the selected tab of the current window. |update-properties| - https://developer.chrome.com/apps/tabs#property-update-updateProperties. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [tab] where: |tab| - Details about the updated tab. The 'tabs.Tab' object does not contain url, pendingUrl, title, and favIconUrl if the 'tabs' permission has not been requested. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/tabs#method-update.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close