The chrome.extension API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in Message Passing.
The chrome.extension API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in Message Passing. * available since Chrome 36 * https://developer.chrome.com/extensions/extension
(get-background-page)
Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.
https://developer.chrome.com/extensions/extension#method-getBackgroundPage.
Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page. https://developer.chrome.com/extensions/extension#method-getBackgroundPage.
(get-extension-tabs)
(get-extension-tabs window-id)
Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window.
|window-id| - https://developer.chrome.com/extensions/extension#property-getExtensionTabs-windowId.
https://developer.chrome.com/extensions/extension#method-getExtensionTabs.
Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window. |window-id| - https://developer.chrome.com/extensions/extension#property-getExtensionTabs-windowId. https://developer.chrome.com/extensions/extension#method-getExtensionTabs.
(get-in-incognito-context)
True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior.
https://developer.chrome.com/extensions/extension#property-inIncognitoContext.
True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior. https://developer.chrome.com/extensions/extension#property-inIncognitoContext.
(get-last-error)
Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be undefined.
https://developer.chrome.com/extensions/extension#property-lastError.
Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be undefined. https://developer.chrome.com/extensions/extension#property-lastError.
(get-url path)
Converts a relative path within an extension install directory to a fully-qualified URL.
|path| - A path to a resource within an extension expressed relative to its install directory.
https://developer.chrome.com/extensions/extension#method-getURL.
Converts a relative path within an extension install directory to a fully-qualified URL. |path| - A path to a resource within an extension expressed relative to its install directory. https://developer.chrome.com/extensions/extension#method-getURL.
(get-views)
(get-views fetch-properties)
Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.
|fetch-properties| - https://developer.chrome.com/extensions/extension#property-getViews-fetchProperties.
https://developer.chrome.com/extensions/extension#method-getViews.
Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. |fetch-properties| - https://developer.chrome.com/extensions/extension#property-getViews-fetchProperties. https://developer.chrome.com/extensions/extension#method-getViews.
(is-allowed-file-scheme-access)
Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
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 [is-allowed-access] where:
|is-allowed-access| - True if the extension can access the 'file://' scheme, false 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/extensions/extension#method-isAllowedFileSchemeAccess.
Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox. 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 [is-allowed-access] where: |is-allowed-access| - True if the extension can access the 'file://' scheme, false 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/extensions/extension#method-isAllowedFileSchemeAccess.
(is-allowed-incognito-access)
Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
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 [is-allowed-access] where:
|is-allowed-access| - True if the extension has access to Incognito mode, false 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/extensions/extension#method-isAllowedIncognitoAccess.
Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox. 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 [is-allowed-access] where: |is-allowed-access| - True if the extension has access to Incognito mode, false 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/extensions/extension#method-isAllowedIncognitoAccess.
(send-request extension-id request)
Sends a single request to other listeners within the extension. Similar to 'runtime.connect', but only sends a single request with an optional response. The 'extension.onRequest' event is fired in each page of the extension.
|extension-id| - The extension ID of the extension you want to connect to. If omitted, default is your own extension. |request| - https://developer.chrome.com/extensions/extension#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 extension, the callback will be called with no arguments and 'runtime.lastError' will be 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/extensions/extension#method-sendRequest.
Sends a single request to other listeners within the extension. Similar to 'runtime.connect', but only sends a single request with an optional response. The 'extension.onRequest' event is fired in each page of the extension. |extension-id| - The extension ID of the extension you want to connect to. If omitted, default is your own extension. |request| - https://developer.chrome.com/extensions/extension#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 extension, the callback will be called with no arguments and 'runtime.lastError' will be 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/extensions/extension#method-sendRequest.
(set-update-url-data data)
Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the Chrome Extension Gallery.
|data| - https://developer.chrome.com/extensions/extension#property-setUpdateUrlData-data.
https://developer.chrome.com/extensions/extension#method-setUpdateUrlData.
Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the Chrome Extension Gallery. |data| - https://developer.chrome.com/extensions/extension#property-setUpdateUrlData-data. https://developer.chrome.com/extensions/extension#method-setUpdateUrlData.
(tap-all-events chan)
Taps all valid non-deprecated events in chromex.ext.extension namespace.
Taps all valid non-deprecated events in chromex.ext.extension namespace.
(tap-on-request-events channel & args)
Fired when a request is sent from either an extension process or a content script.
Events will be put on the |channel| with signature [::on-request [request sender send-response]] where:
|request| - The request sent by the calling script. |sender| - https://developer.chrome.com/extensions/extension#property-onRequest-sender.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/extension#event-onRequest.
Fired when a request is sent from either an extension process or a content script. Events will be put on the |channel| with signature [::on-request [request sender send-response]] where: |request| - The request sent by the calling script. |sender| - https://developer.chrome.com/extensions/extension#property-onRequest-sender. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/extension#event-onRequest.
(tap-on-request-external-events channel & args)
Fired when a request is sent from another extension.
Events will be put on the |channel| with signature [::on-request-external [request sender send-response]] where:
|request| - The request sent by the calling script. |sender| - https://developer.chrome.com/extensions/extension#property-onRequestExternal-sender.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/extension#event-onRequestExternal.
Fired when a request is sent from another extension. Events will be put on the |channel| with signature [::on-request-external [request sender send-response]] where: |request| - The request sent by the calling script. |sender| - https://developer.chrome.com/extensions/extension#property-onRequestExternal-sender. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/extension#event-onRequestExternal.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close