Browser Extension
The Browser Extension API provides developers with deeper integration into the user's Browser via a Browser Extension.
Some users might not have installed the Browser Extension. If a user doesn't have the Browser Extension installed, they will be asked if they want to install it when your extension calls the Browser Extension API. If the user doesn't wish to install it, the API call will throw an error.
You can check if a user has the Browser Extension installed using environment.canAccess(BrowserExtension)
.
API Reference
BrowserExtension.getContent
Get the content of an opened browser tab.
Signature
Example
Parameters
options
Options to control which content to get.
Object
options.format
The format of the content.
"html"
or "text"
or "markdown"
options.tabId
The ID of the tab to get the content from. If not specified, the content of the active tab of the focused window is returned.
number
Return
A Promise that resolves with the content of the tab.
BrowserExtension.getTabs
Get the list of open browser tabs.
Signature
Example
Return
A Promise that resolves with the list of tabs.
Types
BrowserExtension.Tab
Properties
active*
Whether the tab is active in its window. There can only be one active tab per window but if there are multiple browser windows, there can be multiple active tabs.
boolean
id*
The ID of the tab. Tab IDs are unique within a browser session.
number
url*
The URL the tab is displaying.
string
title
The title of the tab. It may also be undefined
if the tab is loading.
string
Last updated