To illustrate how to use the WebExtension APIs, we maintain a repository of example extensions at https://github.com/mdn/webextensions-examples. This article describes how to run these examples and lists the examples along with the WebExtension APIs they demonstrate.
These examples work in Firefox Nightly: most work in earlier versions of Firefox, but check the strict_min_version key in the extension's manifest.json to make sure.
Warning: Some examples work only on specific domains or pages. Details of any restrictions are provided in each example's readme file. None of the examples work in private browsing windows by default, see Extensions in Private Browsing for details.
To try these examples, clone the repository, then install and run the extension using one of these options:
web-ext
, open the extension's source folder at the command line, and use web-ext run
.The extension stays loaded until you restart Firefox.
Warning: Please do not submit these WebExtension examples to addons.mozilla.org (AMO); you do not have to sign the add-on WebExtension examples to run them.
If you want to contribute to the repository, send us a pull request.
Name Description JavaScript APIs annotate-page Displays a sidebar that lets you take notes on web pages.storage.local
tabs.onActivated
tabs.onUpdated
tabs.query()
tabs.Tab
windows.getCurrent()
windows.Window
pageAction.getTitle()
pageAction.onClicked
pageAction.setIcon()
pageAction.setTitle()
pageAction.show()
tabs.insertCSS()
tabs.onUpdated
tabs.query()
tabs.removeCSS()
tabs.Tab
extension.getURL()
runtime.onMessage
tabs.executeScript()
tabs.insertCSS()
tabs.query()
tabs.removeCSS()
tabs.sendMessage()
tabs.Tab
bookmarks.create()
bookmarks.onCreated
bookmarks.onRemoved
bookmarks.remove()
bookmarks.search()
browserAction.onClicked
browserAction.setIcon()
browserAction.setTitle()
tabs.onActivated
tabs.onUpdated
tabs.query()
tabs.Tab
windows.onFocusChanged
alarms.clearAll()
alarms.create()
alarms.onAlarm
pageAction.hide()
pageAction.onClicked
pageAction.show()
tabs.get()
tabs.onActivated
tabs.onUpdated
tabs.query()
tabs.update()
getAll()
onCommand
commands.reset()
commands.update()
tabs.create()
contentScripts.register()
runtime.onMessage
runtime.sendMessage()
menus.create()
menus.onClicked
tabs.executeScript()
contextualIdentities.query()
tabs.create()
tabs.query()
tabs.remove()
cookies.get()
cookies.onChanged
cookies.remove()
cookies.set()
extension.getURL()
runtime.onMessage
tabs.onActivated
tabs.onUpdated
tabs.query()
tabs.Tab
tabs.sendMessage()
devtools.inspectedWindow
devtools.panels
runtime.getURL()
runtime.onMessage
runtime.sendMessage()
tabs.executeScript()
declarative_net_request
manifest key. declarativeNetRequest.Rule
declarativeNetRequest.RuleAction
declarativeNetRequest.RuleCondition
declarativeNetRequest.Rule
declarativeNetRequest.getDynamicRules
declarativeNetRequest.getSessionRules
declarativeNetRequest.updateDynamicRules
declarativeNetRequest.updateSessionRules
permissions.getAll()
permissions.remove()
permissions.request()
declarative_net_request
manifest key. Demonstrates aspects of Manifest Version 3 (MV3): action, host_permissions, and web_accessible_resources, and includes a comparison with Manifest Version 2 (MV2). declarativeNetRequest.Redirect
declarativeNetRequest.Rule
declarativeNetRequest.RuleAction
declarativeNetRequest.RuleCondition
declarativeNetRequest.URLTransform
permissions.contains()
permissions.remove()
permissions.request()
alarms.create()
alarms.onAlarm
theme.update()
notifications.create()
runtime.onMessage
runtime.sendMessage()
browserAction.onClicked
runtime.openOptionsPage()
storage.managed
storage.sync
browserAction.onClicked
extension.getBackgroundPage()
find.find()
find.highlightResults()
runtime.getURL()
runtime.onMessage
runtime.sendMessage()
tabs.create()
tabs.query()
tabs.Tab
omnibox.onInputChanged
omnibox.onInputEntered
omnibox.setDefaultSuggestion()
tabs.create()
tabs.update()
browserAction.onClicked
browsingData.remove()
notifications.create()
storage.local
browserAction.onClicked
identity.getRedirectURL()
identity.launchWebAuthFlow
notifications.create()
history.deleteUrl()
history.search()
pageAction.show()
tabs.onUpdated
tabs.query()
webRequest.filterResponseData()
webRequest.onBeforeRequest
extension.getURL()
runtime.onMessage
tabs.executeScript()
tabs.query()
tabs.sendMessage()
downloads.erase()
downloads.getFileIcon()
downloads.open()
downloads.removeFile()
downloads.search()
cookies.getAll()
tabs.query()
i18n.getMessage()
menus.update()
menus.create()
menus.onClicked
i18n.getMessage()
menus.create()
menus.onClicked
menus.remove()
menus.update()
runtime.lastError
tabs.executeScript()
menus.create()
menus.onClicked
menus.onShown
menus.refresh()
menus.update()
tabs.update()
menus.create()
menus.onClicked
menus.getTargetElement()
pageAction.openPopup()
pageAction.show()
tabs.executeScript()
search.search()
search.get()
menus.create()
menus.onClicked
runtime.onMessage
runtime.sendMessage()
browserAction.onClicked
runtime.connectNative()
storage.local
webNavigation.onCommitted
webNavigation.onCompleted
extension.getURL()
i18n.getMessage()
notifications.create()
runtime.onMessage
runtime.sendMessage()
browserAction.onClicked
tabs.create()
browserAction.onClicked
permissions.getAll()
permissions.remove()
permissions.request()
runtime.getURL()
tabs.create()
theme.reset()
theme.update()
windows.getAll()
windows.onCreated
extension.getURL()
proxy.onRequest
proxy.onError
storage.local
storage.onChanged
storage.local
webRequest.getSecurityInfo()
browserAction.onClicked
notifications.create()
runtime.getManifest()
runtime.onInstalled
runtime.reload()
menus.create()
menus.onClicked
sessions.getTabValue()
sessions.setTabValue()
tabs.insertCSS()
tabs.onCreated
tabs.onUpdated
tabs.query()
browserAction.onClicked
menus.create()
menus.onClicked
runtime.onMessage
runtime.sendMessage()
tabs.create()
windows.create()
storage.local
webRequest.onAuthRequired
webRequest.onCompleted
webRequest.onErrorOccurred
browserAction.setBadgeBackgroundColor()
browserAction.setBadgeText()
tabs.create()
tabs.duplicate()
tabs.getZoom()
tabs.move()
tabs.onCreated
tabs.onMoved
tabs.onRemoved
tabs.query()
tabs.reload()
tabs.remove()
tabs.setZoom()
tabs.Tab
tabs.update()
theme.getCurrent()
theme.onUpdated
windows.getCurrent()
management.getAll()
management.setEnabled()
theme_frame:
.topSites.get()
extension.getBackgroundPage()
webRequest.onBeforeSendHeaders
userScripts.register() (Legacy)
runtime.onMessage
runtime.sendMessage()
userScripts.configureWorld()
userScripts.getScripts()
userScripts.register()
userScripts.resetWorldConfiguration()
userScripts.unregister()
userScripts.update()
permissions.onAdded
permissions.onRemoved
permissions.request()
runtime.onInstalled
runtime.onMessage
runtime.onUserScriptMessage
runtime.openOptionsPage()
runtime.sendMessage()
storage.local
storage.onChanged
storage.session
runtime.onMessage
runtime.sendMessage()
windows.create()
windows.getAll()
windows.getCurrent()
windows.remove()
windows.update()
windows.Window
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4