Found 886 pages:
# | Page | Tags and summary |
---|---|---|
1 | Add-ons | Add-ons, Extension, Extensions, Landing, Mozilla |
Add-ons allow developers to extend and modify the functionality of Firefox. | ||
2 | Add-on Debugger | Advanced, Debugging, Developer, Firefox, Guide, Howto, JavaScript, add-on |
The Add-on Debugger lets you run a subset of the Firefox developer tools in the context of your add-on: | ||
3 | Add-on Manager | Add-on Manager, Add-ons, Guide |
4 | Addon | Add-on Manager, Add-ons, Extensions, Guide, NeedsContent |
5 | AddonAuthor | Add-on Manager, Add-ons |
6 | AddonInstall | Add-on Manager, Add-ons, Extensions, Reference, Référence |
7 | AddonListener | Add-on Manager, Add-ons, Reference, Référence |
8 | AddonManager | Add-on Manager, Add-ons, Interfaces, Interfaces:Scriptable, Reference, Référence |
9 | AddonScreenshot | Add-on Manager, Add-ons |
10 | AddonType | |
11 | AddonUpdateChecker | Add-on Manager, Add-ons, Reference, Référence |
12 | Code Samples | Add-on Manager, Add-ons, Examples |
If you need to determine the directory in which your add-on is installed, code like the following will do the trick. Simply replace YOUREXTENSIONID with your add-on's ID. |
||
13 | InstallListener | Add-on Manager, Add-ons, Reference, Référence |
14 | TypeListener | |
15 | UpdateCheckListener | Add-on Manager, Add-ons, Method, Reference, Référence |
16 | UpdateInfo | Add-on Manager, Add-ons, Property, Reference, Référence |
17 | UpdateListener | Add-on Manager, Add-ons, Extensions, Method, Reference, Référence |
18 | Add-on Repository | AMO, Add-on Manager, Add-ons |
19 | SearchCallback | Add-on Manager, Add-ons |
20 | Add-on SDK | Add-on SDK, Jetpack |
Using the Add-on SDK, you can create Firefox add-ons. You can use various standard Web technologies: JavaScript, HTML, and CSS, to create the add-ons. The SDK includes JavaScript APIs, which you can use to create add-ons and tools for creating, running, testing, and packaging add-ons. | ||
21 | Builder | |
The Add-on Builder was a web-based development environment that allowed developers to create add-ons using the SDK APIs, but without needing to use the jpm command line tool. It was retired on April 1, 2014, and the "builder.addons.mozilla.org" domain now redirects to this page. |
||
22 | Guides | Add-on SDK |
This page lists more theoretical in-depth articles about the SDK. | ||
23 | Content Scripts | Add-on SDK |
Many add-ons need to access and modify the content of web pages. But the main add-on code doesn't get direct access to web content. Instead, SDK add-ons need to factor the code that gets access to web content into separate scripts that are called content scripts. This page describes how to develop and implement content scripts. | ||
24 | Communicating With Other Scripts | |
This section of the guide explains how content scripts can communicate with: | ||
25 | Communicating using "port" | |
To enable add-on scripts and content scripts to communicate with each other, each end of the conversation has access to a port object. |
||
26 | Communicating using "postMessage" | Add-on SDK |
As an alternative to port , content modules support the built-in message event. In most cases port is preferable to message events. However, the context-menu module does not support port , so to send messages from a content script to the add-on via a context menu object, you must use message events. |
||
27 | Cross-domain Content Scripts | Add-on SDK, Add-ons, Extensions |
By default, content scripts don't have any cross-domain privileges. In particular, they can't: | ||
28 | Interacting with page scripts | Add-on SDK, Add-ons, Extensions |
By default, content scripts loaded by add-ons and scripts loaded by web pages are insulated from each other: | ||
29 | Loading Content Scripts | |
The constructors for content-script-using objects such as panel and page-mod define a group of options for loading content scripts: | ||
30 | Reddit Example | Advanced, CodingScripting, JavaScript, Mobile |
This example add-on creates a panel containing the mobile version of Reddit. When the user clicks on the title of a story in the panel, the add-on opens the linked story in a new tab in the main browser window. | ||
31 | port | |
This article documents the port object, which is used to communicate between a content script and the main add-on code. |
||
32 | self | |
This article documents the self object that is available as a global in content scripts. self provides: |
||
33 | Contributor's Guide | |
No summary! | ||
34 | Classes and Inheritance | Add-on SDK |
A class is a blueprint from which individual objects are created. These individual objects are the instances of the class. Each class defines one or more members, which are initialized to a given value when the class is instantiated. Data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have behavior. Inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. Unlike languages like C++ and Java, JavaScript does not have native support for classical inheritance. Instead, it uses something called prototypal inheritance. As it turns out, it is possible to emulate classical inheritance using prototypal inheritance, but not without writing a significant amount of boilerplate code. | ||
35 | Content Processes | Add-on SDK |
A content process was supposed to run all the code associated with a single tab. Conversely, an add-on process was supposed to run all the code associated with a single add-on. Neither content or add-on proceses were ever actually implemented, but by the time they were cancelled, the SDK was already designed with them in mind. To understand this article, it's probably best to read it as if content and add-on processes actually exist. | ||
36 | Getting Started | Add-on SDK |
Learn how to contribute to the Add-on SDK. | ||
37 | Modules | Add-ons, Extensions |
A module is a self-contained unit of code, which is usually stored in a file, and has a well defined interface. The use of modules greatly improves the maintainability of code, by splitting it up into independent components, and enforcing logical boundaries between them. Unfortunately, JavaScript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/ importing names. We will show how to do each of these things using the built-in Components object provided by Xulrunner application such as Firefox and Thunderbird. | ||
38 | Private Properties | |
People have come up with several ways to emulate private properties using existing language features. This article discusses two common techniques: one using prefixes, the other closures. | ||
39 | Firefox Compatibility | Add-on SDK |
No summary! | ||
40 | Module structure of the SDK | Add-on SDK |
CommonJS is the underlying infrastructure for both the SDK and the add-ons you build using the SDK. A CommonJS module is a piece of reusable JavaScript: it exports certain objects which are thus made available to dependent code. CommonJS defines: | ||
41 | Multiprocess Firefox and the SDK | Firefox OS, Guide, SDK |
This article explains how developers can test whether SDK-based add-ons are compatible with multiprocess Firefox, and how to fix them if they are not. | ||
42 | Porting the Library Detector | Add-on SDK, Add-ons, Example, Extensions, Sample code, Tutorial |
This example walks through the process of porting a XUL-based add-on to the SDK. It's a very simple add-on and a good candidate for porting because there are suitable SDK APIs for all its features. | ||
43 | Program ID | |
The Program ID is a unique identifier for your add-on. When you package your add-on for distribution using jpm xpi , it will become the ID field in the add-on's Install Manifest. |
||
44 | SDK API Lifecycle | |
Developers using the SDK's APIs need to know how far they can trust that a given API will not change in future releases. At the same time, developers maintaining and extending the SDK's APIs need to be able to introduce new APIs that aren't yet fully proven, and to retire old APIs when they're no longer optimal or supported by the underlying platform. | ||
45 | SDK and XUL Comparison | |
That's not the whole story. If you need more flexibility than the SDK's High-Level APIs provide, you can use its Low-level APIs to load XPCOM objects directly or to manipulate the DOM directly as in a traditional bootstrapped extension. | ||
46 | Testing the Add-on SDK | Add-on SDK, CFX, JPM, SDK |
With a checkout of the mozilla/addon-sdk repository (or a checkout of the m-c repo and cd into the addon-sdk/source directory) there are many means to run the addon-sdk tests. | ||
47 | Two Types of Scripts | |
On the web, JavaScript executes in the context of a web page, and has access to that page's DOM content. This enables you to call functions like: | ||
48 | Working with Events | |
The Add-on SDK supports event-driven programming. | ||
49 | XUL Migration Guide | |
This guide aims to help you migrate a XUL-based add-on to the SDK. | ||
50 | High-Level APIs | Add-on SDK |
Modules listed on this page implement high-level APIs for building add-ons: creating user interfaces, interacting with the web, and interacting with the browser. | ||
51 | addon-page | Add-on SDK, Add-ons, Extensions, Reference, Référence |
Create a page that does not contain navigational elements. | ||
52 | base64 | Add-on SDK |
Data encoding and decoding using Base64 algorithms. | ||
53 | clipboard | Add-on SDK |
Interact with the system clipboard, setting and getting its contents. | ||
54 | context-menu | Add-on SDK, Add-ons, Extensions, Firefox, SDK |
Adds items, submenus, and menu separators to the page's context menu. | ||
55 | hotkeys | Add-on SDK |
Assign hotkey combinations to functions in your add-on. | ||
56 | indexed-db | Add-on SDK |
Exposes the IndexedDB API to add-ons. | ||
57 | l10n | Add-on SDK |
Localize strings appearing in the add-on's JavaScript code. | ||
58 | notifications | Add-on SDK, Notifications |
Display transient, toaster-style desktop messages to the user. | ||
59 | page-mod | Add-on SDK |
Run scripts in the context of web pages whose URL matches a given pattern. | ||
60 | page-worker | Add-on SDK |
Create a permanent, invisible page and access its DOM. | ||
61 | panel | Add-on SDK, Add-ons, Extensions |
Creates transient dialogs to implement part of an add-on's user interface. | ||
62 | passwords | Add-on SDK |
Interact with Firefox's Password Manager to add, retrieve and remove stored credentials. | ||
63 | private-browsing | Add-on SDK |
Check whether a given object is private, so an add-on can respect private browsing | ||
64 | querystring | Add-on SDK |
Utility functions for working with query strings. | ||
65 | request | NeedsUpdate, SDK, add-on |
Make simple network requests. | ||
66 | selection | Add-on SDK |
Get and set text and HTML selections in the current web page. | ||
67 | self | Add-on SDK |
Access data that is bundled with the add-on, and add-on metadata. | ||
68 | simple-prefs | Add-on SDK |
Store preferences across application restarts. | ||
69 | simple-storage | Add-on SDK, Add-ons, Reference, Référence |
Lets an add-on store data so that it's retained across Firefox restarts. | ||
70 | system | Add-on SDK |
Query the add-on's environment and access arguments passed to it. | ||
71 | tabs | Add-on SDK |
Open, manipulate, and access tabs, and receive tab events. | ||
72 | timers | Add-on SDK |
Set one-off and periodic timers. | ||
73 | ui | Add-on SDK, Add-ons, Extensions, Reference |
Provides access to button, toolbar, and sidebar UI objects. | ||
74 | url | Add-on SDK |
Construct, validate, and parse URLs. | ||
75 | webextension | |
Provides functions for communicating with an embedded WebExtension. | ||
76 | widget | Add-on SDK |
Create a simple user interface for an add-on in Firefox's add-on bar. | ||
77 | windows | Add-on SDK |
Enumerate and examine open browser windows, open new windows, and listen for window events. | ||
78 | Low-Level APIs | |
Modules in this section implement low-level APIs. These modules fall roughly into three categories: | ||
79 | /loader | |
Create CommonJS module loaders. | ||
80 | chrome | |
The chrome module gives an Add-on SDK add-on access to the Components object, which in turn gives it access to a large set of privileged low-level Firefox APIs. |
||
81 | console/plain-text | |
Constructor for a console instance. | ||
82 | console/traceback | |
Functionality similar to Python's traceback module. | ||
83 | content/content | |
Re-exports three objects from three other modules: Loader , Worker , and Symbiont . |
||
84 | content/loader | |
Provides one of the building blocks for those modules that use content scripts to interact with web content, such as panel and page-mod . |
||
85 | content/mod | |
Provides functions to modify a page content. | ||
86 | content/symbiont | |
Used by SDK modules that can load web content and attach content scripts to it. | ||
87 | content/worker | |
Used in the internal implementation of SDK modules which use content scripts to interact with web content. | ||
88 | core/heritage | |
Helper functions for inheritance. | ||
89 | core/namespace | |
Provides an API for creating namespaces for objects, which effectively may be used for creating fields that are not part of objects public API. | ||
90 | core/promise | |
Implementation of promises to make asynchronous programming easier. | ||
91 | dev/panel | |
Enables you to extend the Firefox Developer Tools. | ||
92 | event/core | |
The event/core module allows the creation of APIs to broadcast and subscribe to events. |
||
93 | event/target | |
Create objects that broadcast events. | ||
94 | frame/hidden-frame | |
Creates Firefox frames (i.e. XUL <iframe> elements) that are not displayed to the user. |
||
95 | frame/utils | |
Provides helper functions for working with platform internals like frames and browsers. | ||
96 | fs/path | |
Provides access to the local filesystem with the NodeJS path module API. | ||
97 | io/byte-streams | |
Provides streams for reading and writing bytes. | ||
98 | io/file | |
Provides access to the local filesystem. | ||
99 | io/text-streams | |
Provides streams for reading and writing text. | ||
100 | lang/functional | |
Functional helper methods. | ||
101 | lang/type | |
Functions for working with type detection. | ||
102 | loader/cuddlefish | Add-on SDK, CFX |
The SDK's module loader. | ||
103 | loader/sandbox | |
Create JavaScript sandboxes and execute scripts in them. | ||
104 | net/url | |
Enables you to read content from a URI. | ||
105 | net/xhr | |
Provides access to XMLHttpRequest functionality. |
||
106 | places/bookmarks | |
Create, modify, and retrieve bookmarks. | ||
107 | places/favicon | |
Helper functions for working with favicons. | ||
108 | places/history | |
Access the user's browsing history. | ||
109 | platform/xpcom | |
Implement XPCOM objects, factories, and services. | ||
110 | preferences/event-target | Add-on SDK |
Listen to changes to the Preferences system in Firefox. | ||
111 | preferences/service | Add-on SDK, Jetpack, SDK |
Access the Preferences system in Firefox. | ||
112 | remote/child | Module, Reference, Référence, SDK |
Enables an SDK module loaded into a child process to access web content in the child process and communicate with modules in the main process. | ||
113 | remote/parent | Reference, Référence, SDK |
Enables you to load modules, and privileged parts of your add-on in general, into child processes. | ||
114 | stylesheet/style | |
Modify styles using stylesheet files or CSS rules. | ||
115 | stylesheet/utils | |
Helper functions for working with stylesheets. | ||
116 | system/child_process | |
An implementation of the node.js child_process API. |
||
117 | system/environment | |
Access, set and clear environment variables. | ||
118 | system/events | |
API for working with the application observer service. | ||
119 | system/runtime | |
Access to information about Firefox's runtime environment. | ||
120 | system/unload | |
Register callbacks that are called when a module is unloaded. | ||
121 | system/xul-app | |
Information about the application on which your add-on is running. | ||
122 | tabs/utils | |
Functions for working with XUL tabs and the XUL tabbrowser object. |
||
123 | test/assert | Add-on SDK, JPM |
Implements the assert interface defined in the CommonJS Unit Testing specification version 1.1. |
||
124 | test/harness | |
Test harness setup and execution. | ||
125 | test/httpd | |
An HTTP server for the Mozilla platform, which can be used in unit tests. | ||
126 | test/runner | |
Sets up unit tests. | ||
127 | test/utils | |
Helper methods used in the CommonJS Unit Testing suite. | ||
128 | ui/button/action | |
Add a button to the Firefox user interface. | ||
129 | ui/button/toggle | |
Add a toggle button to the Firefox user interface. | ||
130 | ui/frame | |
Create HTML iframes, using bundled HTML, CSS and JavaScript, that can be added to a designated area of the Firefox user interface. | ||
131 | ui/id | |
Create UI component IDs. | ||
132 | ui/sidebar | |
Enables you to create sidebars. | ||
133 | ui/toolbar | |
Add a toolbar to the Firefox user interface. | ||
134 | util/array | |
Helper functions for working with arrays. | ||
135 | util/collection | |
A simple list-like class and utilities for using it. | ||
136 | util/deprecate | |
Functions to deprecate code. | ||
137 | util/list | |
Building blocks for composing lists. | ||
138 | util/match-pattern | |
Test strings containing URLs against simple patterns. | ||
139 | util/object | |
Functions for working with objects. | ||
140 | util/uuid | |
Generate or parse UUIDs. | ||
141 | window/utils | |
Functions for working with browser windows. | ||
142 | Release notes | Add-on SDK |
GitHub commits made between Firefox 34 and Firefox 35. This will not include any uplifts made after this release entered Aurora. | ||
143 | Tools | Add-on SDK, CFX, JPM |
Articles listed here provide a reference for the SDK's tools: | ||
144 | cfx | Add-on SDK, CFX |
Enables you to test, run, and package add-ons. cfx is is no longer supported as of Firefox 44 and no longer accepted for add-on submission, jpm should now be used instead. | ||
145 | cfx to jpm | CFX, JPM, SDK, add-on |
A guide to working with jpm if you're already familiar with cfx. | ||
146 | console | Add-on SDK |
Enables your add-on to log error, warning or informational messages. | ||
147 | jpm | Add-on SDK, JPM |
jpm is a command-line tool that enables you to test, run, and package add-ons. | ||
148 | jpm-mobile | ADB, Add-ons, JPM, Mobile, Testing, travis-ci |
The Node-based replacement for cfx --force-mobile . Enables you to run and test add-ons for Firefox Mobile (aka Fennec). |
||
149 | jpmignore | JPM |
Use .jpmignore to ignore files from your XPI builds created via jpm. |
||
150 | package.json | CommonJS, JPM, SDK, add-on, package.json |
The package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the Add-ons Manager, but other metadata required of add-ons. |
||
151 | Tutorials | Add-on SDK |
This page lists practical hands-on articles about how to accomplish specific tasks using the SDK. | ||
152 | Add a Context Menu Item | Add-on SDK, Firefox, Guide |
To add items and submenus to the Firefox context menu, use the context-menu module. |
||
153 | Add a Menu Item to Firefox | Add-on SDK |
The SDK doesn't provide a built-in API to add new menu items to Firefox. But it's extensible by design, so anyone can build and publish modules for add-on developers to use. | ||
154 | Adding a Button to the Toolbar | Add-on SDK |
To add a button to the toolbar, use the action button or toggle button modules. | ||
155 | Annotator | Add-on SDK |
In this tutorial we'll build an add-on that uses many of the SDK's high-level APIs. | ||
156 | Creating annotations | Add-on SDK, Add-ons, Beginner, Extensions, Tutorial |
We'll use two objects to create annotations: a page-mod to find page elements that the user can annotate, and a panel for the user to enter the annotation text itself. |
||
157 | Displaying annotations | Add-on SDK |
In this chapter we'll use a page-mod to locate elements of web pages that have annotations associated with them, and a panel to display the annotations. | ||
158 | Implementing the widget | Add-on SDK, Add-ons, Beginner, Extensions, Tutorial |
We want the widget to do two things: | ||
159 | Overview | Add-on SDK |
The annotator uses content scripts to build user interfaces, get user input, and examine the DOM of pages loaded by the user. | ||
160 | Storing annotations | Add-on SDK |
Now we are able to create annotations, let's store them using the simple-storage module. In this chapter we will cover three topics relating to persistent storage: |
||
161 | Chrome Authority | |
The most powerful low-level modules are run with "chrome privileges", which gives them access to the infamous Components object, which grants unfettered access to the host system. From this, the module can do pretty much anything the browser is capable of. To obtain these privileges, the module must declare its intent with a statement like the following: |
||
162 | Creating Event Targets | |
This tutorial describes the use of low-level APIs. These APIs are still in active development, and we expect to make incompatible changes to them in future releases. | ||
163 | Creating Reusable Modules | Add-on SDK |
With the SDK you don't have to keep all your add-on in a single "index.js" file. You can split your code into separate modules with clearly defined interfaces between them. You then import and use these modules from other parts of your add-on using the require() statement, in exactly that same way that you import core SDK modules like page-mod or panel . |
||
164 | Developing for Firefox Mobile | Add-on SDK |
Firefox for Android implements its UI using native Android widgets instead of XUL. With the add-on SDK you can develop add-ons that run on this new version of Firefox Mobile as well as on the desktop version of Firefox. | ||
165 | Display a Popup | Add-on SDK |
To display a popup dialog, use the panel module. A panel's content is defined using HTML. You can run content scripts in the panel: although the script running in the panel can't directly access your main add-on code, you can exchange messages between the panel script and the add-on code. |
||
166 | Getting Started (jpm) | Add-on SDK, JPM |
In this tutorial we've built and packaged an add-on using three commands: | ||
167 | Getting started (cfx) | |
In this tutorial we've built and packaged an add-on using three commands: | ||
168 | List Open Tabs | Add-on SDK |
To list the open tabs, you can iterate over the tabs object itself. |
||
169 | Listen for Page Load | Add-on SDK |
You can get notifications about new pages loading using the tabs module. The following add-on listens to the tab's built-in ready event and just logs the URL of each tab as the user loads it: |
||
170 | Listening for Load and Unload | |
If your add-on exports a function called main() , then that function will be called whenever the add-on is loaded, and it will be passed an object containing a string describing the reason it was loaded as well as any arguments passed to it. If your add-on exports a function called onUnload() , then that function will be called when the add-on is unloaded, and it will be passed a string describing the reason it was unloaded. |
||
171 | Localization | Add-on SDK, Localization |
The SDK supports localization of strings appearing in: | ||
172 | Logging | Add-on SDK |
The DOM console object is useful for debugging JavaScript. Because DOM objects aren't available to the main add-on code, the SDK provides its own global console object with most of the same methods as the DOM console , including methods to log error, warning, or informational messages. You don't have to require() anything to get access to the console. It is automatically made available to you. |
||
173 | Modifying Web Pages Based on URL | Add-on SDK |
To modify any pages that match a particular pattern (for example, "http://example.org/") as they are loaded, use page-mod module. |
||
174 | Modifying the Page Hosted by a Tab | Add-on SDK |
To modify the page hosted by a particular tab, load one or more content scripts into it using attach() method of tab object. The job of these scripts is to interact with web content. |
||
175 | Open a Web Page | Add-on SDK |
To open a new web page, you can use the tabs module: |
||
176 | Troubleshooting | |
If you're having trouble getting the Add-on SDK up and running, don't panic! This page lists some starting points that might help you track down your problem. | ||
177 | Unit Testing | Add-on SDK, JPM |
The SDK provides a framework to help create and run unit tests for your code. To demonstrate how it works we'll write some unit tests for a simple Base64 encoding module. | ||
178 | Using XPCOM without chrome | Bookmarks, Chrome, SDK, XPCOM |
With the low-level module sdk/platform/xpcom , it's possible to exclude chrome and XPCOMUtils in some cases. Below is an example for the XPCOM bookmark observer. |
||
179 | Using third-party modules (jpm) | Addon-SDK, JPM |
First, while in the root of your add-on, install the package that contains the modules you want to use: | ||
180 | Adding extensions using the Windows registry | Add-ons, Extensions, Installing, Mozilla, Registry, Windows, Windows Registry |
This document explains how to "install" Firefox and Thunderbird extensions using the Windows Registry. This mechanism is designed to make it easier for third-party installers to register extensions with Firefox and Thunderbird. | ||
181 | Bootstrapped extensions | Add-ons, Extensions, Firefox 4, Gecko 2.0, Guide, Localization |
Traditional extensions include overlays, wherein the application can load up XUL from the extension's package and automatically apply it on top its own UI. While this makes creating extensions that add to the application's user interface relatively easy, it means that updating, installing, or disabling an extension requires an application restart. | ||
182 | Browser extensions | Add-ons, Landing, WebExtensions |
Extensions can extend and modify the capability of a browser. Extensions for Firefox are built using WebExtension APIs, a cross-browser system for developing extensions. To a large extent the system is compatible with the extension API supported by Google Chrome and Opera. Extensions written for these browsers will in most cases run in Firefox or Microsoft Edge with just a few changes. The API is also fully compatible with multiprocess Firefox. | ||
183 | Add a button to the toolbar | WebExtensions |
Toolbar buttons are one of the main UI components available to extensions. Toolbar buttons live in the main browser toolbar and contain an icon. When the user clicks the icon, one of two things can happen: | ||
184 | Alternative distribution options | Installation, Landing, WebExtensions, add-on |
The standard add-on distribution and installation process is through Firefox using a signed XPI file obtained from addons.mozilla.org (AMO) (for listed add-ons) or a download set up by a developer (for unlisted add-ons). | ||
185 | Add-ons for desktop apps | Add-ons, Desktop apps, Guide, Installation, WebExtensions |
If you have developed an add-on to complement a desktop application, there are several ways you can install the add-on: | ||
186 | Add-ons in the enterprise | Add-ons, Guide, Installation |
As an enterprise IT administrator you may wish to install add-ons for your users automatically, this page discusses the options. | ||
187 | Sideloading add-ons | Guide, Installation, Sideloading, WebExtensions |
You may want to send a user your add-on’s XPI file by some means other than a web download, such as an email distribution of a beta version for user testing. In this case, there are two practical options for installing the add-on: | ||
188 | Anatomy of an extension | WebExtensions |
An extension consists of a collection of files, packaged for distribution and installation. In this article, we will quickly go through the files that might be present in an extension. | ||
189 | Browser actions | WebExtensions |
A browser action is a button you can add to the browser toolbar. Users can click the button to interact with your extension. | ||
190 | Browser compatibility for manifest.json | Add-ons, WebExtensions, manifest.json |
No summary! | ||
191 | Browser support for JavaScript APIs | WebExtensions |
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. | ||
192 | Chrome incompatibilities | WebExtensions |
Extensions built with WebExtension APIs are designed to be compatible with Chrome and Opera extensions: as far as possible, extensions written for those browsers should run on Firefox with minimal changes. | ||
193 | Comparison with XUL/XPCOM extensions | WebExtensions |
At a very basic level, XUL/XPCOM extensions are similar to extensions developed with WebExtensions. They both include: | ||
194 | Comparison with the Add-on SDK | WebExtensions |
The basic structure and concepts of the Add-on SDK are shared by WebExtensions. Both technologies include: | ||
195 | Content Security Policy | WebExtensions |
Content Security Policy (CSP) is a mechanism to help prevent websites from inadvertantly executing malicious content. A website specifies a CSP using an HTTP header sent from the server. The CSP is mostly concerned with specifying legitimate sources of various types of content, such as scripts or embedded plugins. For example, a website can use it to specify that the browser should only execute JavaScript served from the website itself, and not from any other sources. A CSP can also instruct the browser to disallow potentially unsafe practices, such as the use of eval() . |
||
196 | Content scripts | WebExtensions |
A content script is a part of your extension that runs in the context of a particular web page (as opposed to background scripts which are part of the extension, or scripts which are part of the web site itself, such as those loaded using the <script> element). |
||
197 | Debugging | WebExtensions |
This article explains how you can use the Firefox developer tools to debug extensions built with WebExtension APIs. | ||
198 | Debugging (before Firefox 50) | |
This article explains how you can use the built-in Firefox developer tools to debug extensions developed with WebExtension APIs. If you're trying to debug an add-on developed with the Add-on SDK, please see the guide to the Add-on Debugger. | ||
199 | Developing extensions for Firefox for Android | Beginner, Guide, Mobile, WebExtensions |
You will approach the coding of an extension for Firefox for Android in the same way as you would for a desktop extension using WebExtension APIs; using a text editor or tool of your choice to write the code. However, when you get to testing and debugging your extension you need to follow a different process, this article walks you through that process. | ||
200 | Differences between desktop and Android extensions | Guide, Mobile, WebExtensions |
Firefox for Android offers a subset of the WebExtensions APIs available to the desktop version of Firefox. Some of these differences are due to the nature of the Android environment and therefore the features Firefox can implement, others are where Firefox for Android does not yet offer all the desktop features. This article describes and explains these differences and looks at the impact they might have on your add-on development. | ||
201 | Embedded WebExtensions | WebExtensions |
Starting in Firefox 51, you can embed a WebExtension in a classic bootstrapped extension or an Add-on SDK add-on. | ||
202 | Example extensions | WebExtensions |
To help illustrate how to develop extensions, we maintain a repository of simple example extensions at https://github.com/mdn/webextensions-examples. This article describes the WebExtension APIs used in that repository. | ||
203 | Extending the developer tools | |
You can use WebExtensions APIs to extend the browser's built-in developer tools. To create a devtools extension, include the "devtools_page" key in manifest.json: | ||
204 | Extensions and the add-on ID | WebExtensions |
Firefox add-ons contain a unique identifier which is used both inside Firefox itself and on the addons.mozilla.org (AMO) website. For example, it's used by Firefox to check for updates to installed add-ons and to identify which objects (such as data stores) are controlled by this add-on. | ||
205 | Getting started with web-ext | Guide, Installing, Testing, Tools, WebExtension, packaging, web-ext |
web-ext is a command line tool designed to speed up various parts of the extension development process, making development faster and easier. This article explains how to install and use web-ext. | ||
206 | Implement a settings page | WebExtensions |
A settings page gives users a way to see and change settings (sometimes also called "preferences" or "options") for the extension. | ||
207 | Interact with the clipboard | WebExtensions |
Extensions built using WebExtension APIs can interact with the system clipboard using document.execCommand() : |
||
208 | Intercept HTTP requests | Add-ons, Extensions, How-to, WebExtensions |
To intercept HTTP requests, use the webRequest API. This API enables you to add listeners for various stages of making an HTTP request. In the listeners, you can: |
||
209 | Internationalization | Article, Guide, Internationalization, Localization, WebExtensions, i18n, messages.json, placeholders, predefined messages |
The WebExtensions API has a rather handy module available for internationalizing extensions — i18n. In this article we'll explore its features and provide a practical example of how it works. The i18n system for extensions built using WebExtension APIs is similar to common JavaScript libraries for i18n such as i18n.js. | ||
210 | JavaScript APIs | WebExtensions |
No summary! | ||
211 | alarms | |
Schedule code to run at a specific time in the future. This is like setTimeout() and setInterval() , except that those functions don't work with background pages that are loaded on demand. |
||
212 | alarms.Alarm | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, alarm, alarms |
Information about a single alarm. This object is returned from alarms.get() and alarms.getAll() , and is passed into the alarms.onAlarm listener. |
||
213 | alarms.clear() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, alarms, clear |
Cancels an alarm, given its name. | ||
214 | alarms.clearAll() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, alarms, clearAll |
Cancels all active alarms. | ||
215 | alarms.create() | API, Add-ons, Create, Extensions, Method, Non-standard, Reference, WebExtensions, alarms |
Creates a new alarm. | ||
216 | alarms.get() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, alarms, get |
Gets an alarm, given its name. | ||
217 | alarms.getAll() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, alarms, getAll |
Gets all active alarms for the extension. | ||
218 | alarms.onAlarm | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, alarms, onAlarm |
Fired when any alarm set by the extension goes off. | ||
219 | bookmarks | API, Add-ons, Bookmarks, Extensions, Interface, Non-standard, Reference, WebExtensions |
The WebExtensions bookmarks API lets an extension interact with and manipulate the browser's bookmarking system. You can use it to bookmark pages, retrieve existing bookmarks, and edit, remove, and organize bookmarks. |
||
220 | bookmarks.BookmarkTreeNode | API, Add-ons, BookmarkTreeNode, Bookmarks, Extensions, Non-standard, Reference, Type, WebExtensions |
An object of type bookmarks.BookmarkTreeNode represents a node in the bookmark tree, where each node is a bookmark or bookmark folder. Child nodes are ordered by an index within their respective parent folders. |
||
221 | bookmarks.BookmarkTreeNodeUnmodifiable | API, Add-ons, BookmarkTreeNodeUnmodifiable, Bookmarks, Extensions, Non-standard, Reference, Type, WebExtensions |
The bookmarks.BookmarkTreeNodeUnmodifiable type is used to indicate the reason that a node in the bookmark tree (where each node is either a bookmark or a bookmark folder) cannot be changed. This is used as the value of the bookmarks.BookmarkTreeNode.unmodifiable.unmodifiable field on bookmark nodes. |
||
222 | bookmarks.CreateDetails | API, Add-ons, Bookmarks, CreateDetails, Extensions, Non-standard, Reference, Type, WebExtensions |
The CreateDetails type is used to describe the properties of a new bookmark or bookmark folder when calling the bookmarks.create() method. |
||
223 | bookmarks.create() | API, Add-ons, Bookmarks, Create, Extensions, Method, Non-standard, Reference, WebExtensions |
Creates a bookmark or folder as a child of the BookmarkTreeNode with the specified parentId . To create a folder, omit or leave empty the CreateDetails.url parameter. |
||
224 | bookmarks.get() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, WebExtensions, get |
Given the ID of a bookmarks.BookmarkTreeNode or an array of such IDs, the bookmarks.get() method retrieves the matching nodes. |
||
225 | bookmarks.getChildren() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, WebExtensions, getChildren |
bookmarks.getChildren() retrieves all the immediate children of a given bookmark folder, identified as a BookmarkTreeNode ID. |
||
226 | bookmarks.getRecent() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, WebExtensions, getRecent |
The bookmarks.getRecent() method retrieves a specified number of the most recently added bookmarks as an array of BookmarkTreeNode objects. |
||
227 | bookmarks.getSubTree() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, WebExtensions, getSubTree |
The bookmarks.getSubTree() method asynchronously retrieves a bookmarks.BookmarkTreeNode , given its ID. |
||
228 | bookmarks.getTree() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, WebExtensions, getTree |
bookmarks.getTree() returns an array containing the root of the bookmarks tree as a bookmarks.BookmarkTreeNode object. |
||
229 | bookmarks.move() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, WebExtensions, move |
The bookmarks.move() method moves the specified BookmarkTreeNode to the specified destination within the tree of bookmarks. This lets you move a bookmark to a new folder and/or position within the folder. |
||
230 | bookmarks.onChanged | API, Add-ons, Bookmarks, Event, Extensions, Non-standard, Reference, WebExtensions, onChanged |
Fired when there is a change to: | ||
231 | bookmarks.onChildrenReordered | API, Add-ons, Bookmarks, Event, Extensions, Non-standard, Reference, WebExtensions, onChildrenReordered |
Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a call to bookmarks.move() or a drag operation in the UI. |
||
232 | bookmarks.onCreated | API, Add-ons, Bookmarks, Event, Extensions, Non-standard, Reference, WebExtensions, onCreated |
Fired when a bookmark item (a bookmark or a folder) is created. | ||
233 | bookmarks.onImportBegan | API, Add-ons, Bookmarks, Event, Extensions, Non-standard, Reference, WebExtensions, onImportBegan |
Fired when the browser has started importing a set of bookmarks. | ||
234 | bookmarks.onImportEnded | API, Add-ons, Bookmarks, Event, Extensions, Non-standard, Reference, WebExtensions, onImportEnded |
Fired when the browser has finished importing a set of bookmarks. | ||
235 | bookmarks.onMoved | API, Add-ons, Bookmarks, Event, Extensions, Non-standard, Reference, WebExtensions, onMoved |
Fired when a bookmark or folder is moved to a different parent folder and/or position within a folder. | ||
236 | bookmarks.onRemoved | API, Add-ons, Bookmarks, Event, Extensions, Non-standard, Reference, WebExtensions, onRemoved |
Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents. | ||
237 | bookmarks.remove() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, WebExtensions, remove |
The bookmarks.remove() method removes a single bookmark or an empty bookmark folder. |
||
238 | bookmarks.removeTree() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, WebExtensions, removeTree |
The bookmarks.removeTree() method recursively removes a bookmark folder and all of its contents. |
||
239 | bookmarks.search() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, Search, WebExtensions |
The bookmarks.search() function searches for bookmarks matching the given query. |
||
240 | bookmarks.update() | API, Add-ons, Bookmarks, Extensions, Method, Non-standard, Reference, Update, WebExtensions |
bookmarks.update() updates the title and/or URL of a bookmark, or the name of a bookmark folder. |
||
241 | browserAction | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, browserAction |
Adds a button to the browser's toolbar. | ||
242 | browserAction.ColorArray | API, Add-ons, ColorArray, Extensions, Non-standard, Reference, Type, WebExtensions, browserAction |
An array of four integers in the range 0-255, defining an RGBA color. The four values specify the following channels: |
||
243 | browserAction.ImageDataType | API, Add-ons, Extensions, ImageDataType, Non-standard, Reference, Type, WebExtensions, browserAction |
Pixel data for an image. Must be an ImageData object (for example, from a <canvas> element). |
||
244 | browserAction.disable() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, disable |
Disables the browser action for a tab, meaning that it cannot be clicked when that tab is active. | ||
245 | browserAction.enable() | API, Add-ons, Enable, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction |
Enables the browser action for a tab. By default, browser actions are enabled for all tabs. | ||
246 | browserAction.getBadgeBackgroundColor() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, getBadgeBackgroundColor |
Gets the background color of the browser action's badge. | ||
247 | browserAction.getBadgeText() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, getBadgeText |
Gets the browser action's badge text. | ||
248 | browserAction.getPopup() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, getPopup |
Gets the HTML document set as the popup for this browser action. | ||
249 | browserAction.getTitle() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, getTitle |
Gets the browser action's title. | ||
250 | browserAction.onClicked | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, browserAction, onClicked |
Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. | ||
251 | browserAction.openPopup() | API, Add-ons, Extensions, Non-standard, Reference, WebExtensions, browserAction, openPopup |
This API is also available as browser.browserAction.openPopup() in a version that returns a promise. |
||
252 | browserAction.setBadgeBackgroundColor() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, setBadgeBackgroundColor |
Sets the background color for the badge. | ||
253 | browserAction.setBadgeText() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, setBadgeText |
Sets the badge text for the browser action. The badge is displayed on top of the icon. | ||
254 | browserAction.setIcon() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, setIcon |
Sets the icon for the browser action. | ||
255 | browserAction.setPopup() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, setPopup |
Sets the HTML document that will be opened as a popup when the user clicks on the browser action's icon. | ||
256 | browserAction.setTitle() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, browserAction, setTitle |
Sets the browser action's title. The title is displayed in a tooltip over the browser action's icon. You can pass a tabId in as an optional parameter — if you do this then the title is changed only for the given tab. |
||
257 | browserSettings | |
Promises are not supported in Edge. Use callbacks instead. | ||
258 | browserSettings.cacheEnabled | API, Add-ons, Extensions, Property, Reference, WebExtensions, browserSettings, cacheEnabled |
A BrowserSetting object that can be used to globally enable or disable the browser cache. |
||
259 | browsingData | |
Enables extensions to clear the data that is accumulated while the user is browsing. | ||
260 | browsingData.DataTypeSet | API, Add-ons, DataTypeSet, Extensions, Reference, Type, WebExtensions, browsingData |
The browsingData.DataTypeSet type describes a set of data types. |
||
261 | browsingData.RemovalOptions | API, Add-ons, Extensions, Reference, RemovalOptions, Type, WebExtensions, browsingData |
The browsingData.RemovalOptions type contains options to control certain aspects of browsing data removal. |
||
262 | browsingData.remove() | API, Add-ons, Extensions, Method, Reference, WebExtensions, browsingData, remove |
Removes the specified browsing data. | ||
263 | browsingData.removeCache() | API, Add-ons, Extensions, Method, Reference, WebExtensions, browsingData, removeCache |
Clears the browser's cache. | ||
264 | browsingData.removeCookies() | API, Add-ons, Extensions, Method, Reference, WebExtensions, browsingData, removeCookies |
Clears the browser's cookies. | ||
265 | browsingData.removeDownloads() | API, Add-ons, Extensions, Method, Reference, WebExtensions, browsingData, removeDownloads |
Clears the browser's download history. Note that this does not delete the downloaded objects themselves, only records of downloads in the browser's history. | ||
266 | browsingData.removeFormData() | API, Add-ons, Extensions, Method, Reference, WebExtensions, browsingData, removeDownloads |
Clears data that the browser has saved for autofilling forms. | ||
267 | browsingData.removeHistory() | API, Add-ons, Extensions, Method, Reference, WebExtensions, browsingData, removeHistory |
Clears the record of web pages that the user has visited (browsing history). | ||
268 | browsingData.removePasswords() | API, Add-ons, Extensions, Method, Reference, WebExtensions, browsingData, removePasswords |
Clears saved passwords. | ||
269 | browsingData.removePluginData() | API, Add-ons, Extensions, Method, Reference, WebExtensions, browsingData, removePluginData |
Clears data stored by browser plugins. | ||
270 | browsingData.settings() | API, Add-ons, Extensions, Method, Reference, Settings, WebExtensions, browsingData |
Browsers have a built-in "Clear History" feature, which enables the user to clear various types of browsing data. This has a UI that enables the user to select what type of data to remove (e.g. history, downloads, ...) and how far back in time to remove data. | ||
271 | commands | |
Listen for the user executing commands that you have registered using the commands manifest.json key. |
||
272 | Command | API, Add-ons, Command, Extensions, Non-standard, Reference, Type, WebExtensions, commands |
Information about a command. This contains the information specified for the command in the commands manifest.json key. |
||
273 | getAll() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, commands, getAll |
Gets all commands for the extention that you have registered using the commands manifest.json key. |
||
274 | onCommand | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, commands, onCommand |
Events have three functions: | ||
275 | contextMenus | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, contextMenus |
Add items to the browser's context menu, to be displayed in the contexts you specify. For example, you can show the item only when the user clicks on an image, or on an editable element, or when part of a page is selected. | ||
276 | contextMenus.ACTION_MENU_TOP_LEVEL_LIMIT | API, Add-ons, Extensions, Non-standard, Property, Reference, WebExtensions, contextMenus |
The maximum number of top level extension items that can be added to a context menu item whose ContextType is "browser_action" or "page_action". Any items beyond this limit will be ignored. |
||
277 | contextMenus.ContextType | API, Add-ons, ContextType, Extensions, Non-standard, Reference, Type, WebExtensions, contextMenus |
The different contexts a menu can appear in. | ||
278 | contextMenus.ItemType | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, contextMenus, itemtype |
The type of menu item. | ||
279 | contextMenus.OnClickData | API, Add-ons, Extensions, Non-standard, OnClickData, Reference, Type, WebExtensions, contextMenus |
Information sent when a context menu item is clicked. | ||
280 | contextMenus.create() | API, Add-ons, Create, Extensions, Method, Non-standard, Reference, WebExtensions, contextMenus |
Creates a new context menu item, given an options object defining properties for the item. | ||
281 | contextMenus.onClicked | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, contextMenus, onClicked |
Fired when a context menu item is clicked. | ||
282 | contextMenus.remove() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, contextMenus, remove |
Removes a context menu item. | ||
283 | contextMenus.removeAll() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, contextMenus, removeAll |
Removes all context menu items added by the extension. | ||
284 | contextMenus.update() | API, Add-ons, Extensions, Method, Non-standard, Reference, Update, WebExtensions, contextMenus |
Updates a previously created context menu item. | ||
285 | contextualIdentities | WebExtensions |
Work with contextual identities: list, create, remove, and update contextual identities. | ||
286 | contextualIdentities.create() | API, Add-ons, Create, Extensions, Method, Reference, WebExtensions, contextualIdentities |
Creates a new contextual identity. Once created, the user will be able to create new tabs belonging to this contextual identity, just as they can with the built-in identities. | ||
287 | contextualIdentities.get() | API, Add-ons, Extensions, Method, Reference, WebExtensions, contextualIdentities, get |
Gets information about a contextual identity, given its cookie store ID. | ||
288 | contextualIdentities.query() | API, Add-ons, Extensions, Method, Reference, WebExtensions, contextualIdentities, query |
Gets information about all contextual identities, or about those contextual identities that match a given filter argument. | ||
289 | contextualIdentities.remove() | API, Add-ons, Extensions, Method, Reference, WebExtensions, contextualIdentities, remove |
Removes a contextual identity, given its cookie store ID. | ||
290 | contextualIdentities.update() | API, Add-ons, Extensions, Method, Reference, Update, WebExtensions, contextualIdentities |
Updates properties of a contextual identity, given its cookie store ID. | ||
291 | contextualIdentitities.ContextualIdentity | API, Add-ons, ContextualIdentity, Extensions, Reference, Type, WebExtensions, contextualIdentities |
The contextualIdentities .ContextualIdentity type describes a single contextual identity. |
||
292 | cookies | API, Add-ons, Cookies, Extensions, Interface, Non-standard, Reference, WebExtensions |
Enables extensions to get and set cookies, and be notified when they change. | ||
293 | cookies.Cookie | API, Add-ons, Cookies, Extensions, Non-standard, Reference, Type, WebExtensions, cookie |
The Cookie type of the cookies API represents information about an HTTP cookie. |
||
294 | cookies.CookieStore | API, Add-ons, CookieStore, Cookies, Extensions, Non-standard, Reference, Type, WebExtensions |
The CookieStore type of the cookies API represents a cookie store in the browser. |
||
295 | cookies.OnChangedCause | API, Add-ons, Cookies, Extensions, Non-standard, OnChangedCause, Reference, Type, WebExtensions |
The OnChangedCause type of the cookies API represents the reason a cookie changed. |
||
296 | cookies.get() | API, Add-ons, Cookies, Extensions, Method, Non-standard, Reference, WebExtensions, get |
The get() method of the cookies API retrieves information about a single cookie, given its name and URL. |
||
297 | cookies.getAll() | API, Add-ons, Cookies, Extensions, Method, Non-standard, Reference, WebExtensions, getAll |
The getAll() method of the cookies API retrieves all cookies from a single cookie store that match the given information. |
||
298 | cookies.getAllCookieStores() | API, Add-ons, Cookies, Extensions, Method, Non-standard, Reference, WebExtensions, getAllCookieStores |
The getAllCookieStores() method of the cookies API returns a list of all cookie stores. |
||
299 | cookies.onChanged | API, Add-ons, Cookies, Event, Extensions, Non-standard, Reference, WebExtensions, onChanged |
The onChanged event of the cookies API is fired when a cookie is set or removed. |
||
300 | cookies.remove() | API, Add-ons, Cookies, Extensions, Method, Non-standard, Reference, WebExtensions, remove |
The remove() method of the cookies API deletes a cookie, given its name and URL. |
||
301 | cookies.set() | API, Add-ons, Cookies, Extensions, Method, Non-standard, Reference, WebExtensions, set |
The set() method of the cookies API sets a cookie containing the specified cookie data. This method is equivalent to issuing an HTTP Set-Cookie header during a request to a given URL. |
||
302 | devtools.inspectedWindow | API, Add-ons, Extensions, Reference, WebExtensions, devtools.inspectedWindow |
The devtools.inspectedWindow API lets a devtools extension interact with the window that the developer tools are attached to. |
||
303 | devtools.inspectedWindow.eval() | API, Add-ons, Extensions, Reference, WebExtensions, devtools.inspectedWindow, eval |
Executes JavaScript in the window that the devtools are attached to. | ||
304 | devtools.inspectedWindow.reload() | API, Add-ons, Extensions, Reference, WebExtensions, devtools.inspectedWindow, reload |
Reloads the window that the devtools are attached to. | ||
305 | devtools.inspectedWindow.tabId | API, Add-ons, Extensions, Reference, WebExtensions, devtools.inspectedWindow, tabId |
The ID of the tab that this instance of the devtools is attached to, represented as a number. |
||
306 | devtools.network | API, Add-ons, Extensions, Reference, WebExtensions, devtools.network |
The devtools.network API lets a devtools extension get information about network requests associated with the window that the devtools are attached to (the inspected window). |
||
307 | devtools.network.onNavigated | API, Add-ons, Extensions, Reference, WebExtensions, devtools.network |
Fired when the user navigates the inspected window to a new page. | ||
308 | devtools.panels | API, Add-ons, Extensions, Reference, WebExtensions, devtools.panels |
The devtools.panels API lets a devtools extension define its user interface inside the devtools window. |
||
309 | devtools.panels.ExtensionPanel | API, Add-ons, Extensions, Reference, WebExtensions, devtools.panels |
An ExtensionPanel represents a panel added to the devtools. It's the resolution of the Promise returned by browser.devtools.panels.create() . |
||
310 | devtools.panels.create() | API, Add-ons, Create, Extensions, Reference, WebExtensions, devtools.panels |
Adds a new panel to the devtools. | ||
311 | devtools.panels.onThemeChanged | API, Add-ons, DevTools, Reference, WebExtensions, devtools.panels, onThemeChanged |
Fired when the devtools theme changes. | ||
312 | devtools.panels.themeName | API, Add-ons, DevTools, Reference, WebExtensions, devtools.panels, themeName |
The name of the currently selected devtools theme. | ||
313 | downloads | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, downloads |
Enables extensions to interact with the browser's download manager. You can use this API module to download files, cancel, pause, resume downloads, and show downloaded files in the file manager. | ||
314 | downloads.BooleanDelta | API, Add-ons, BooleanDelta, Extensions, Non-standard, Reference, Type, WebExtensions, downloads |
The BooleanDelta type of the downloads API represents the difference between two booleans. |
||
315 | downloads.DangerType | API, Add-ons, DangerType, Extensions, Non-standard, Reference, Type, WebExtensions, downloads |
The DangerType type of the downloads API defines a set of possible reasons that a downloadable file might be considered dangerous. |
||
316 | downloads.DoubleDelta | API, Add-ons, DoubleDelta, Extensions, Non-standard, Reference, Type, WebExtensions, downloads |
The DoubleDelta type of the downloads API represents the difference between two doubles. |
||
317 | downloads.DownloadItem | API, Add-ons, DownloadItem, Extensions, Non-standard, Reference, Type, WebExtensions, downloads |
The DownloadItem type of the downloads API represents a downloaded file. |
||
318 | downloads.DownloadQuery | API, Add-ons, DownloadQuery, Extensions, Non-standard, Reference, Type, WebExtensions, downloads |
The DownloadQuery type of the downloads API defines a set of parameters that can be used to search the downloads manager for a specific set of downloads. |
||
319 | downloads.DownloadTime | API, Add-ons, DownloadTime, Extensions, Non-standard, Reference, Type, WebExtensions, downloads |
The DownloadTime type of the downloads API represents the time a download took to complete. |
||
320 | downloads.FilenameConflictAction | API, Add-ons, Extensions, FilenameConflictAction, Non-standard, Reference, Type, WebExtensions, downloads |
The FilenameConflictAction type of the downloads API specifies what to do if the name of a downloaded file conflicts with an existing file. |
||
321 | downloads.InterruptReason | API, Add-ons, Extensions, InterruptReason, Non-standard, Reference, Type, WebExtensions, downloads |
The InteruptReason type of the downloads API defines a set of possible reasons why a download was interrupted. |
||
322 | downloads.State | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, downloads, state |
The State type of the downloads API defines different states that a current download can be in. |
||
323 | downloads.StringDelta | API, Add-ons, Extensions, Non-standard, Reference, StringDelta, Type, WebExtensions, downloads |
The StringDelta type of the downloads API represents the difference between two strings. |
||
324 | downloads.acceptDanger() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, acceptDanger, downloads |
The acceptDanger () function of the downloads API prompts the user to either accept or cancel a potentially dangerous download. |
||
325 | downloads.cancel() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, cancel, downloads |
The cancel () function of the downloads API cancels a download. The call will fail if the download is not active: for example, because it has completed downloading. |
||
326 | downloads.download() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, download, downloads |
The download() function of the downloads API downloads a file, given its URL and other optional preferences. |
||
327 | downloads.drag() | API, Add-ons, Drag, Extensions, Method, Non-standard, Reference, WebExtensions, downloads |
The drag () function of the downloads API initiates dragging the downloaded file to another application. |
||
328 | downloads.erase() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, downloads, erase |
The erase () function of the downloads API erases matching DownloadItems from the browser's download history, without deleting the downloaded files from disk. |
||
329 | downloads.getFileIcon() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, downloads, getFileIcon |
The getFileIcon () function of the downloads API retrieves an icon for the specified download. |
||
330 | downloads.onChanged | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, downloads, onChanged |
The onChanged () event of the downloads API is fired when any of a downloads.DownloadItem 's properties changes (except for bytesReceived ). |
||
331 | downloads.onCreated | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, downloads, onCreated |
The onCreated () event of the downloads API fires when a download begins, i.e. when downloads.download() is sucessfully invoked. |
||
332 | downloads.onErased | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, downloads, onErased |
The onErased () event of the downloads API fires when a download is erased from the browser history. |
||
333 | downloads.open() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, downloads, open |
The open () function of the downloads API opens the downloaded file with its associated application. |
||
334 | downloads.pause() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, downloads, pause |
The pause () function of the downloads API pauses a download. |
||
335 | downloads.removeFile() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, downloads, removeFile |
The removeFile () function of the downloads API removes a downloaded file from disk. |
||
336 | downloads.resume() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, downloads, resume |
The resume () function of the downloads API resumes a paused download. If the request was successful, the download will be unpaused and progress will resume. The resume() call will fail if the download is not active: for example, because it has finished downloading. |
||
337 | downloads.search() | API, Add-ons, Extensions, Method, Non-standard, Reference, Search, WebExtensions, downloads |
The search() function of the downloads API queries the DownloadItems available in the browser's downloads manager, and returns those that match the specified search criteria. |
||
338 | downloads.setShelfEnabled() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, downloads, setShelfEnabled |
The setShelfEnabled () function of the downloads API enables or disables the gray shelf at the bottom of every window associated with the current browser profile. The shelf will be disabled as long as at least one extension has disabled it. |
||
339 | downloads.show() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, downloads, show |
The show () function of the downloads API shows the downloaded file in its containing folder in the underlying platform's file manager. |
||
340 | downloads.showDefaultFolder() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, downloads, showDefaultFolder |
The showDefaultFolder () function of the downloads API opens the default downloads folder in the platform's file manager. |
||
341 | events | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, events |
Common types used by APIs that dispatch events. | ||
342 | events.Event | API, Add-ons, Event, Extensions, Non-standard, Reference, Type, WebExtensions, events |
An object which allows the addition and removal of listeners for a browser event. | ||
343 | events.Rule | API, Add-ons, Extensions, Non-standard, Reference, Rule, Type, WebExtensions, events |
Description of a declarative rule for handling events. | ||
344 | events.UrlFilter | API, Add-ons, Extensions, Non-standard, Reference, Type, UrlFilter, WebExtensions, events |
Describes various criteria for filtering URLs. If all of the criteria specified in the filter's properties match the URL, then the filter matches. Filters are often provided to API methods in an Array of UrlFilters. For example, webNavigation listeners can be added with a filter which is an object with a single url property that is an Array of UrlFilters, e.g. {url:[UrlFilter,UrlFilter,...]} . If any filter within the Array of UrlFilters matches, then it is considered a match for the Array. Effectively, the criteria specified within a single filter are AND'ed together, while all of the individual filters within an Array are OR'ed. |
||
345 | extension | API, Add-ons, Extension, Extensions, Interface, Non-standard, Reference, WebExtensions |
Utilities related to your extension. Get URLs to resources packages with your extension, get the Window object for your extension's pages, get the values for various settings. Note that the messaging APIs in this module are deprecated in favor of the equivalent APIs in the runtime module. |
||
346 | extension.ViewType | API, Add-ons, Extension, Extensions, Non-standard, Reference, Type, ViewType, WebExtensions |
The type of extension view. | ||
347 | extension.getBackgroundPage() | API, Add-ons, Extension, Extensions, Method, Non-standard, Reference, WebExtensions, getBackgroundPage |
Alias for runtime.getBackgroundPage() . |
||
348 | extension.getExtensionTabs() | API, Add-ons, Extension, Extensions, Method, Non-standard, Reference, WebExtensions, 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. |
||
349 | extension.getURL() | API, Add-ons, Extension, Extensions, Method, Non-standard, Reference, WebExtensions, getURL |
Converts a relative path within an extension's install directory to a fully-qualified URL. | ||
350 | extension.getViews() | API, Add-ons, Extension, Extensions, Method, Non-standard, Reference, WebExtensions, getViews |
Returns an array of the Window objects for each of the pages running inside the current extension. This includes, for example: | ||
351 | extension.inIncognitoContext | API, Add-ons, Extension, Extensions, Non-standard, Property, Reference, WebExtensions, inIncognitoContext |
Boolean value, true for content scripts running inside private browsing tabs and for extension pages running inside a private browsing process. |
||
352 | extension.isAllowedFileSchemeAccess() | API, Add-ons, Extension, Extensions, Method, Non-standard, Reference, WebExtensions, isAllowedFileSchemeAccess |
None. | ||
353 | extension.isAllowedIncognitoAccess() | API, Add-ons, Extension, Extensions, Method, Non-standard, Reference, WebExtensions, isAllowedIncognitoAccess |
Check whether the extension is allowed access to tabs opened in "private browsing" mode. | ||
354 | extension.lastError | API, Add-ons, Extension, Extensions, Non-standard, Property, Reference, WebExtensions, lastError |
An alias for runtime.lastError . |
||
355 | extension.onRequest | API, Add-ons, Event, Extension, Extensions, Non-standard, Reference, WebExtensions, onRequest |
Fired when a request is sent from either an extension process or a content script. | ||
356 | extension.onRequestExternal | API, Add-ons, Event, Extension, Extensions, Non-standard, Reference, WebExtensions, onRequestExternal |
Fired when a request is sent from another extension. | ||
357 | extension.sendRequest() | API, Add-ons, Extension, Extensions, Method, Non-standard, Reference, WebExtensions, 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. |
||
358 | extension.setUpdateUrlData() | API, Add-ons, Extension, Extensions, Method, Non-standard, Reference, WebExtensions, setUpdateUrlData |
Sets parameters for the extension's update URL. This value is ignored for extensions that are hosted in the browser vendor's store. | ||
359 | extensionTypes | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, extensionTypes |
Some common types used in other WebExtension APIs. | ||
360 | extensionTypes.ImageDetails | API, Add-ons, Extensions, ImageDetails, Non-standard, Reference, Type, WebExtensions, extensionTypes |
Details about the format and quality of an image. | ||
361 | extensionTypes.ImageFormat | API, Add-ons, Extensions, ImageFormat, Non-standard, Reference, Type, WebExtensions, extensionTypes |
The format of an image. | ||
362 | extensionTypes.InjectDetails | API, Add-ons, Extensions, InjectDetails, Non-standard, Reference, Type, WebExtensions, extensionTypes |
This type is given as a parameter to the tabs.executeScript() , tabs.insertCSS() , and tabs.removeCSS() methods. For the details of its properties and what they are used for, see the documentation pages for those methods: |
||
363 | extensionTypes.RunAt | API, Add-ons, Extensions, Non-standard, Reference, RunAt, Type, WebExtensions, extensionTypes |
The soonest that the JavaScript or CSS will be injected into the tab. | ||
364 | history | API, Add-ons, Extensions, History, Interface, Non-standard, Reference, WebExtensions |
Use the history API to interact with the browser history. |
||
365 | history.HistoryItem | API, Add-ons, Extensions, History, HistoryItem, Non-standard, Reference, Type, WebExtensions |
A HistoryItem object provides information about a page in the browser history. |
||
366 | history.TransitionType | API, Add-ons, Extensions, History, Non-standard, Reference, TransitionType, Type, WebExtensions |
This describes how the browser navigated to a particular page. For example, "link" means that the browser navigated to the page because the user clicked a link. | ||
367 | history.VisitItem | API, Add-ons, Extensions, History, Non-standard, Reference, Type, VisitItem, WebExtensions |
An object describing a single visit to a page. | ||
368 | history.addUrl() | API, Add-ons, Extensions, History, Method, Non-standard, Reference, WebExtensions, addUrl |
Adds a record to the browser's history of a visit to the given URL. The visit's time is recorded as the time of the call, and the TransitionType is recorded as "link". |
||
369 | history.deleteAll() | API, Add-ons, Extensions, History, Method, Non-standard, Reference, WebExtensions, deleteAll |
Deletes all visits from the browser's history. | ||
370 | history.deleteRange() | API, Add-ons, Extensions, History, Method, Non-standard, Reference, WebExtensions, deleteRange |
Removes all visits to pages that the user made during the given time range. If this removes all visits made to a given page, then the page will be no longer appear in the browser history and history.onVisitRemoved will fire for it. |
||
371 | history.deleteUrl() | API, Add-ons, Extensions, History, Method, Non-standard, Reference, WebExtensions, deleteUrl |
Removes all visits to the given URL from the browser history. | ||
372 | history.getVisits() | API, Add-ons, Extensions, History, Method, Non-standard, Reference, WebExtensions, getVisits |
Retrieves information about all visits to the given URL. | ||
373 | history.onTitleChanged | API, Add-ons, Event, History, Reference, WebExtensions, onTitleChanged |
Events have three functions: | ||
374 | history.onVisitRemoved | API, Add-ons, Event, Extensions, History, Non-standard, Reference, WebExtensions, onVisitRemoved |
Fired when a page is removed completely from the browser history. | ||
375 | history.onVisited | API, Add-ons, Event, Extensions, History, Non-standard, Reference, WebExtensions, onVisited |
Fired each time the user visits a page. A history.HistoryItem object is passed to the listener. This event fires before the page has loaded. |
||
376 | history.search() | API, Add-ons, Extensions, History, Method, Non-standard, Reference, Search, WebExtensions |
Searches the browser's history for history.HistoryItem objects matching the given criteria. |
||
377 | i18n | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, i18n |
Functions to internationalize your extension. You can use these APIs to get localized strings from locale files packaged with your extension, find out the browser's current language, and find out the value of its Accept-Language header. | ||
378 | Locale-specific message reference | Internationalization, Localization, Reference, String, WebExtensions, i18n, message, messages.json, placeholders |
Each internationalized extension has at least one file named messages.json that provides locale-specific strings. This page describes the format of messages.json files. |
||
379 | i18n.LanguageCode | API, Add-ons, Extensions, LanguageCode, Non-standard, Reference, Type, WebExtensions, i18n |
A language tag such as "en-US" or "fr ". |
||
380 | i18n.detectLanguage() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, detectLanguage, i18n |
Detects the language of the provided text using the Compact Language Detector (CLD). | ||
381 | i18n.getAcceptLanguages() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getAcceptLanguages, i18n |
Gets the accept-languages of the browser. This is different from the locale used by the browser. To get the locale, use i18n.getUILanguage . |
||
382 | i18n.getMessage() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getMessage, i18n |
Gets the localized string for the specified message. | ||
383 | i18n.getUILanguage() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getUILanguage, i18n |
Gets the UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages. |
||
384 | identity | API, Add-ons, Extensions, Identity, Reference, WebExtensions |
Use the identity API to get an OAuth2 authorization code or access token, which an extension can then use to access user data from a service which supports OAuth2 access (such as a Google or a Facebook account). | ||
385 | identity.getRedirectURL() | API, Add-ons, Extensions, Identity, Method, Reference, WebExtensions, getRedirectURL |
Generates a URL that you can use as a redirect URL. | ||
386 | identity.launchWebAuthFlow | API, Add-ons, Extensions, Identity, Method, Reference, WebExtensions, launchWebAuthFlow |
Performs the first part of an OAuth2 flow, including user authentication and client authorization. | ||
387 | idle | API, Add-ons, Extensions, Idle, Interface, Non-standard, Reference, WebExtensions |
Find out when the user's system is idle, locked, or active. | ||
388 | idle.IdleState | API, Add-ons, Extensions, Idle, IdleState, Non-standard, Reference, Type, WebExtensions |
String describing the device's idle state. | ||
389 | idle.onStateChanged | API, Add-ons, Event, Extensions, Idle, Non-standard, Reference, WebExtensions, onStateChanged |
Fired when the system changes to an active, idle or locked state. The event listener is passed a string that has one of three values: | ||
390 | idle.queryState() | API, Add-ons, Extensions, Idle, Method, Non-standard, Reference, WebExtensions, queryState |
Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. |
||
391 | idle.setDetectionInterval() | API, Add-ons, Extensions, Idle, Method, Non-standard, Reference, WebExtensions, setDetectionInterval |
Sets the interval, in seconds, used to determine when the system is in an idle state for idle.onStateChanged events. The default interval is 60 seconds. |
||
392 | management | API, Add-ons, Extensions, Reference, WebExtensions, management |
Get information about installed add-ons. | ||
393 | ExtensionInfo | API, Add-ons, ExtensionInfo, Extensions, Reference, Type, WebExtensions, management |
An ExtensionInfo object contains information about an add-on. |
||
394 | management.get() | API, Add-ons, Method, Reference, WebExtensions, get, management |
Retrieves an ExtensionInfo object containing information about the specified add-on. |
||
395 | management.getAll() | API, Add-ons, Method, Reference, WebExtensions, getAll, management |
Retrieves an array of ExtensionInfo objects, one for each installed add-on. |
||
396 | management.getPermissionWarningsById() | API, Add-ons, Method, Reference, WebExtensions, getPermissionWarningsById, management |
Given the ID of an add-on, this function returns the permission warnings for it as an array of strings. | ||
397 | management.getPermissionWarningsByManifest() | API, Add-ons, Method, Reference, WebExtensions, getPermissionWarningsByManifest, management |
Given the text of a manifest.json file, this function returns the permission warnings that would be given for the resulting add-on, as an array of strings. | ||
398 | management.getSelf() | API, Add-ons, Method, Reference, WebExtensions, getSelf, management |
Retrieves an ExtensionInfo object containing information about the calling add-on. |
||
399 | management.onDisabled() | API, Add-ons, Event, Reference, WebExtensions, management, onDisabled |
Fired when an add-on is disabled. | ||
400 | management.onEnabled() | API, Add-ons, Event, Reference, WebExtensions, management, onEnabled |
Fired when an add-on is enabled. | ||
401 | management.onInstalled() | API, Add-ons, Event, Reference, WebExtensions, management, onInstalled |
Fired when an add-on is installed. | ||
402 | management.onUninstalled() | API, Add-ons, Event, Reference, WebExtensions, management, onUninstalled |
Fired when an add-on is uninstalled. | ||
403 | management.setEnabled() | API, Add-ons, Method, Reference, WebExtensions, management, setEnabled |
Enables or disables the given add-on. | ||
404 | management.uninstall() | API, Add-ons, Method, Reference, WebExtensions, management, uninstall |
Uninstalls an add-on, given its ID. | ||
405 | management.uninstallSelf() | API, Add-ons, Method, Reference, WebExtensions, management, uninstallSelf |
Uninstalls the calling add-on. | ||
406 | notifications | |
Display notifications to the user, using the underlying operating system's notification mechanism. Because this API uses the operating system's notification mechanism, the details of how notifications appear and behave may differ according to the operating system and the user's settings. | ||
407 | notifications.NotificationOptions | API, Add-ons, Extensions, Non-standard, NotificationOptions, Notifications, Reference, Type, WebExtensions |
This type contains all the data needed to: | ||
408 | notifications.TemplateType | API, Add-ons, Extensions, Non-standard, Notifications, Reference, TemplateType, Type, WebExtensions |
This is a string, and represents the type of notification to create. There are four types of notification: "basic", "image", "list", "progress". | ||
409 | notifications.clear() | API, Add-ons, Extensions, Method, Non-standard, Notifications, Reference, WebExtensions, clear |
Clears a notification, given its ID. | ||
410 | notifications.create() | API, Add-ons, Create, Extensions, Method, Non-standard, Notifications, Reference, WebExtensions |
Creates and displays a notification. | ||
411 | notifications.getAll() | API, Add-ons, Extensions, Method, Non-standard, Notifications, Reference, WebExtensions, getAll |
Gets all currently active notifications created by the extension. | ||
412 | notifications.onButtonClicked | API, Add-ons, Event, Extensions, Non-standard, Notifications, Reference, WebExtensions, onButtonClicked |
Fired when the user clicks one of the notification's buttons. | ||
413 | notifications.onClicked | API, Add-ons, Event, Extensions, Non-standard, Notifications, Reference, WebExtensions, onClicked |
Fired when the user clicks a notification, but not on any of the notification's buttons (for that, see notifications.onButtonClicked ). |
||
414 | notifications.onClosed | API, Add-ons, Event, Extensions, Non-standard, Notifications, Reference, WebExtensions, onClosed |
Fired when a notification is closed, either by the system or by the user. | ||
415 | notifications.update() | API, Add-ons, Extensions, Method, Non-standard, Notifications, Reference, Update, WebExtensions |
Updates a notification, given its ID. | ||
416 | omnibox | API, Add-ons, Extensions, Reference, WebExtensions, omnibox |
Enables extensions to implement customised behavior when the user types into the browser's address bar. | ||
417 | omnibox.OnInputEnteredDisposition | API, Add-ons, Extensions, OnInputEnteredDisposition, Reference, Type, WebExtensions, omnibox |
The omnibox.OnInputEnteredDisposition type describes how the extension should handle a user selection from the suggestions in the address bar's drop-down list. |
||
418 | omnibox.SuggestResult | API, Add-ons, Extensions, Reference, SuggestResult, Type, WebExtensions, omnibox |
The omnibox.SuggestResult type defines a single suggestion that the extension can add to the address bar's drop-down list. |
||
419 | omnibox.onInputCancelled | API, Add-ons, Event, Extensions, Reference, WebExtensions, omnibox, onInputCancelled |
Fired when the user has cancelled their interaction with your extension (for example, by clicking outside the address bar). | ||
420 | omnibox.onInputChanged | API, Add-ons, Event, Extensions, Reference, WebExtensions, omnibox, onInputChanged |
Fired whenever the user changes their input, after they have started interacting with your extension by entering its keyword in the address bar and then pressing the space key. | ||
421 | omnibox.onInputEntered | API, Add-ons, Event, Extensions, Reference, WebExtensions, omnibox, onInputEntered |
Fired when the user has selected one of the suggestions your extension has added to the address bar's drop-down list. | ||
422 | omnibox.onInputStarted | API, Add-ons, Event, Extensions, Reference, WebExtensions, omnibox, onInputStarted |
Fired when the user starts interacting with your extension by entering its keyword in the address bar and then pressing the space key. | ||
423 | omnibox.setDefaultSuggestion() | API, Add-ons, Extensions, Method, Reference, WebExtensions, omnibox, setDefaultSuggestion |
Set the default suggestion to appear in the address bar drop-down list when the user starts interacting with your extension. | ||
424 | pageAction | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, pageAction |
A page action is a clickable icon inside the browser's address bar. | ||
425 | pageAction.ImageDataType | API, Add-ons, Extensions, ImageDataType, Non-standard, Reference, Type, WebExtensions, pageAction |
Pixel data for an image. | ||
426 | pageAction.getPopup() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getPopup, pageAction |
Gets the URL for the HTML document set as the popup for this page action. | ||
427 | pageAction.getTitle() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getTitle, pageAction |
Gets the title of the page action. | ||
428 | pageAction.hide() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, hide, pageAction |
Hides the page action for a given tab. | ||
429 | pageAction.onClicked | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onClicked, pageAction |
Fired when a page action icon is clicked. This event will not fire if the page action has a popup. | ||
430 | pageAction.setIcon() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, pageAction, setIcon |
Sets the icon for the page action. | ||
431 | pageAction.setPopup() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, pageAction, setPopup |
Sets the HTML document to be opened as a popup when the user clicks on the page action's icon. | ||
432 | pageAction.setTitle() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, pageAction, setTitle |
Sets the title of the page action. The title is displayed in a tooltip when the user hovers over the page action. | ||
433 | pageAction.show() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, pageAction, show |
Shows the page action for a given tab. The page action is shown whenever the given tab is the active tab. | ||
434 | permissions | API, Add-ons, Extensions, Permissions, Reference, WebExtensions |
Extensions need permissions to access many of the more powerful WebExtension APIs. They can ask for permissions at install time by including the permissions they need in the permissions manifest.json key. The main advantages of asking for permissions at install time are: |
||
435 | Permissions | API, Add-ons, Permissions, Reference, Type, WebExtensions |
A Permissions object represents a collection of permissions. |
||
436 | permissions.contains() | API, Add-ons, Contains, Method, Permissions, Reference, WebExtensions |
Check whether the extension has the permissions listed in the given permissions.Permissions object. |
||
437 | permissions.getAll() | API, Add-ons, Method, Permissions, Reference, WebExtensions, getAll |
Retrieve a permissions.Permissions object containing all the permissions currently granted to the extension. |
||
438 | permissions.onAdded | API, Add-ons, Event, Permissions, Reference, WebExtensions, onAdded |
Fired when the extension granted new permissions. | ||
439 | permissions.onRemoved | API, Add-ons, Event, Permissions, Reference, WebExtensions, onRemoved |
Fired when some permissions are removed from the extension. | ||
440 | permissions.remove() | API, Add-ons, Method, Permissions, Reference, WebExtensions, remove |
Ask to give up the permissions listed in the given permissions.Permissions object. |
||
441 | permissions.request() | API, Add-ons, Method, Permissions, Reference, WebExtensions, request |
Ask for the set of permissions listed in the given permissions.Permissions object. |
||
442 | privacy | API, Add-ons, Extensions, Privacy, Reference, WebExtensions |
Access and modify various privacy-related browser settings. | ||
443 | privacy.network | API, Add-ons, Extensions, Network, Privacy, Property, Reference, WebExtensions |
No summary! | ||
444 | privacy.websites | API, Add-ons, Extensions, Privacy, Property, Reference, WebExtensions, websites |
No summary! | ||
445 | proxy | API, Add-ons, Proxy, WebExtensions |
Use the proxy API to register an extended Proxy Auto-Configuration (PAC) file, which implements a policy for proxying web requests. This implementation deviates from standard PAC design in several ways because the de-facto specification for PAC files hasn't changed since its initial implementation circa 1995. There is no standards body maintaining the specification. | ||
446 | proxy.onProxyError | API, Add-ons, Event, Proxy, Reference, WebExtensions, onProxyError |
Fired when there is an error evaluating the PAC file. | ||
447 | proxy.registerProxyScript() | API, Add-ons, Function, Method, Proxy, Reference, WebExtensions, registerProxyScript |
Registers a Proxy Auto-Configuration (PAC) file. The file is executed immediately, and its FindProxyForURL() function will be called for any HTTP, HTTPS, or FTP requests. |
||
448 | runtime | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, runtime |
This module provides information about your extension and the environment it's running in. | ||
449 | runtime.MessageSender | API, Add-ons, Extensions, MessageSender, Non-standard, Reference, Type, WebExtensions, runtime |
An object containing information about the sender of a message or connection request; this is passed to the runtime.onMessage() listener. |
||
450 | runtime.OnInstalledReason | API, Add-ons, Extensions, Non-standard, OnInstalledReason, Reference, Type, WebExtensions, runtime |
The reason that the runtime.onInstalled event is being dispatched. |
||
451 | runtime.OnRestartRequiredReason | API, Add-ons, Extensions, Non-standard, OnRestartRequiredReason, Reference, Type, WebExtensions, runtime |
The reason that the onRestartRequired event is being dispatched. |
||
452 | runtime.PlatformArch | API, Add-ons, Extensions, Non-standard, PlatformArch, Reference, Type, WebExtensions, runtime |
The machine's processor architecture. | ||
453 | runtime.PlatformInfo | API, Add-ons, Extensions, Non-standard, PlatformInfo, Reference, Type, WebExtensions, runtime |
An object containing information about the current platform. | ||
454 | runtime.PlatformNaclArch | API, Add-ons, Extensions, Non-standard, PlatformNaclArch, Reference, Type, WebExtensions, runtime |
The native client architecture. This may be different from arch on some platforms. | ||
455 | runtime.PlatformOs | API, Add-ons, Extensions, Non-standard, PlatformOs, Reference, Type, WebExtensions, runtime |
The operating system the browser is running on. | ||
456 | runtime.Port | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, port, runtime |
A Port object represents one end of a connection between two specific contexts, which can be used to exchange messages. |
||
457 | runtime.RequestUpdateCheckStatus | API, Add-ons, Extensions, Non-standard, Reference, RequestUpdateCheckStatus, Type, WebExtensions, runtime |
Result of a call to runtime.requestUpdateCheck() . |
||
458 | runtime.connect() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, connect, runtime |
Make a connection between different contexts inside the extension. | ||
459 | runtime.connectNative() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, connectNative, runtime |
For more information, see Native messaging. | ||
460 | runtime.getBackgroundPage() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getBackgroundPage, runtime |
Retrieves the Window object for the background page running inside the current extension. | ||
461 | runtime.getBrowserInfo() | |
Returns information about the browser in which the extension is installed. | ||
462 | runtime.getManifest() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getManifest, runtime |
None. | ||
463 | runtime.getPackageDirectoryEntry() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getPackageDirectoryEntry, runtime |
Returns a DirectoryEntry object representing the package directory. |
||
464 | runtime.getPlatformInfo() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getPlatformInfo, runtime |
Returns information about the current platform. | ||
465 | runtime.getURL() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getURL, runtime |
string . The fully-qualified URL to the resource. |
||
466 | runtime.id | API, Add-ons, Extensions, Non-standard, Property, Reference, WebExtensions, id, runtime |
The ID of the extension. | ||
467 | runtime.lastError | API, Add-ons, Extensions, Non-standard, Property, Reference, WebExtensions, lastError, runtime |
The runtime.lastError property is set when an asynchronous function has an error condition that it needs to report to its caller. |
||
468 | runtime.onBrowserUpdateAvailable | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onBrowserUpdateAvailable, runtime |
Fired when an update for the browser is available, but it isn't installed immediately because a browser restart is required. | ||
469 | runtime.onConnect | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onconnect, runtime |
Fired when a connection is made with either an extension process or a content script. | ||
470 | runtime.onConnectExternal | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onConnectExternal, runtime |
Fired when an extension receives a connection request from a different extension. | ||
471 | runtime.onInstalled | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onInstalled, runtime |
Fired when the extension is first installed, when the extension is updated to a new version, and when the browser is updated to a new version. | ||
472 | runtime.onMessage | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onmessage, runtime |
To send a message which will be received by the onMessage listener, use runtime.sendMessage() or (to send a message to a content script) tabs.sendMessage() . |
||
473 | runtime.onMessageExternal | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onMessageExternal, runtime |
This API can't be used in a content script. | ||
474 | runtime.onRestartRequired | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onRestartRequired, runtime |
Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenience to let the restart happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps. | ||
475 | runtime.onStartup | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onStartup, runtime |
Fired when a profile that has this extension installed first starts up. This event is not fired when a private browsing/incognito profile is started, even if this extension is operating in 'split' incognito mode. | ||
476 | runtime.onSuspend | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onSuspend, runtime |
Sent to the event page just before it is unloaded. This gives the extension an opportunity to do some cleanup. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. | ||
477 | runtime.onSuspendCanceled | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onSuspendCanceled, runtime |
Sent after runtime.onSuspend to indicate that the app won't be unloaded after all. |
||
478 | runtime.onUpdateAvailable | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onUpdateAvailable, runtime |
Fired when an update to the extension is available. This event enables an extension to delay an update: for example, because it is in the middle of some operation which should not be interrupted. | ||
479 | runtime.openOptionsPage() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, openOptionsPage, runtime |
This is an asynchronous function that returns a Promise . |
||
480 | runtime.reload() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, reload, runtime |
Reloads the extension. | ||
481 | runtime.requestUpdateCheck() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, requestUpdateCheck, runtime |
Checks to see if an update for the extension is available. | ||
482 | runtime.sendMessage() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, runtime, sendMessage |
Sends a single message to event listeners within your extension or a different extension. | ||
483 | runtime.sendNativeMessage() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, runtime, sendNativeMessage |
Sends a single message from an extension to a native application. | ||
484 | runtime.setUninstallURL() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, runtime, setUninstallURL |
Sets the URL to be visited when the extension is uninstalled. This may be used to clean up server-side data, do analytics, or implement surveys. The URL can be a maximum 255 characters. | ||
485 | sessions | |
Use the sessions API to list, and restore, tabs and windows that have been closed while the browser has been running. | ||
486 | sessions.Filter | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, filter, sessions |
The Filter object enables you to restrict the number of Session objects returned by a call to sessions.getRecentlyClosed() . |
||
487 | sessions.MAX_SESSION_RESULTS | API, Add-ons, Extensions, MAX_SESSION_RESULTS, Non-standard, Property, Reference, WebExtensions, sessions |
This value represents the maximum number of sessions that will be returned by a call to sessions.getRecentlyClosed() . It is read-only for WebExtension code, and is set to 25. |
||
488 | sessions.Session | API, Add-ons, Extensions, Non-standard, Reference, Session, Type, WebExtensions, sessions |
The Session object represents a tab or window that the user has closed in the current browsing session. |
||
489 | sessions.getRecentlyClosed() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getRecentlyClosed, sessions |
Returns an array of Session objects, representing windows and tabs that were closed in the current browsing session (that is: the time since the browser was started). |
||
490 | sessions.onChanged | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onChanged, sessions |
Fired whenever the list of closed tabs or windows changes. | ||
491 | sessions.restore() | API, Add-ons, Extensions, Method, Non-standard, WebExtensions, restore, sessions |
Restores a closed tab or window. Restoring doesn't just reopen the tab or window: it also restores the tab's navigation history so the back/forward buttons will work. Restoring a window will restore all the tabs that the window contained when it was closed. | ||
492 | sidebarAction | |
Gets and sets properties of an extension's sidebar. | ||
493 | sidebarAction.ImageDataType | API, Add-ons, Extensions, ImageDataType, Reference, Type, WebExtensions, sidebarAction |
Pixel data for an image. Must be an ImageData object (for example, from a <canvas> element). |
||
494 | sidebarAction.getPanel() | API, Add-ons, Extensions, Method, Reference, WebExtensions, getPanel, sidebarAction |
Gets a URL to the HTML document that defines the sidebar's contents. | ||
495 | sidebarAction.getTitle() | API, Add-ons, Extensions, Method, Reference, WebExtensions, getTitle, sidebarAction |
Gets the sidebar's title. | ||
496 | sidebarAction.setIcon() | API, Add-ons, Extensions, Method, Reference, WebExtensions, setIcon, sidebarAction |
Sets the icon for the sidebar. | ||
497 | sidebarAction.setPanel() | API, Add-ons, Extensions, Method, Reference, WebExtensions, setPanel, sidebarAction |
Sets the HTML document that defines the content of this sidebar. | ||
498 | sidebarAction.setTitle() | API, Add-ons, Extensions, Method, Reference, WebExtensions, setTitle, sidebarAction |
Sets the sidebar's title. The title is displayed anywhere the browser lists available sidebars. For example, Firefox will show it in the "View > Sidebar" menu. It's also shown at the top o the sidebar when the sidebar is open. | ||
499 | storage | API, Add-ons, Extensions, Interface, Non-standard, Reference, Storage, WebExtensions |
Enables extensions to store and retrieve data, and listen for changes to stored items. | ||
500 | storage.StorageArea | API, Add-ons, Extensions, Non-standard, Reference, Storage, StorageArea, Type, WebExtensions |
StorageArea is an object representing a change to a storage area. | ||
501 | StorageArea.clear() | API, Add-ons, Extensions, Method, Non-standard, Reference, Storage, StorageArea, WebExtensions, remove |
Removes all items from the storage area. | ||
502 | StorageArea.get() | API, Add-ons, Extensions, Method, Non-standard, Reference, Storage, StorageArea, WebExtensions, get |
Retrieves one or more items from the storage area. | ||
503 | StorageArea.getBytesInUse() | API, Add-ons, Extensions, Method, Non-standard, Reference, Storage, StorageArea, WebExtensions, getBytesInUse |
Gets the amount of storage space, in bytes, used one or more items being stored in the storage area. | ||
504 | StorageArea.remove() | API, Add-ons, Extensions, Method, Non-standard, Reference, Storage, StorageArea, WebExtensions, remove |
Removes one or more items from the storage area. | ||
505 | StorageArea.set() | API, Add-ons, Extensions, Method, Non-standard, Reference, Storage, StorageArea, WebExtensions, set |
Stores one or more items in the storage area, or update existing items. | ||
506 | storage.StorageChange | API, Add-ons, Extensions, Non-standard, Reference, Storage, StorageChange, Type, WebExtensions |
StorageChange objects contain the following properties: |
||
507 | storage.local | API, Add-ons, Extensions, Non-standard, Property, Reference, Storage, WebExtensions, local |
Represents the local storage area. Items in local storage are local to the machine the extension was installed on. |
||
508 | storage.managed | API, Add-ons, Extensions, Non-standard, Property, Reference, Storage, WebExtensions, managed |
Respresents the managed storage area. Items in managed storage are set by the domain administrator and are read-only for the extension. Trying to modify this namespace results in an error. |
||
509 | storage.onChanged | API, Add-ons, Event, Extensions, Non-standard, Reference, Storage, WebExtensions, onChanged |
Fired when one or more items change. | ||
510 | storage.sync | API, Add-ons, Extensions, Non-standard, Property, Reference, Storage, Sync, WebExtensions |
Represents the sync storage area. Items in sync storage are synced by the browser, and are available across all instances of that browser that the user is logged into (e.g. via Firefox sync, or a Google account), across different devices. |
||
511 | tabs | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, tabs |
Interact with the browser's tab system. | ||
512 | tabs.MutedInfo | API, Add-ons, Extensions, MutedInfo, Non-standard, Reference, Type, WebExtensions, tabs |
This object contains a boolean indicating whether the tab is muted, and the reason for the last state change. | ||
513 | tabs.MutedInfoReason | API, Add-ons, Extensions, MutedInfoReason, Non-standard, Reference, Type, WebExtensions, tabs |
Specifies the reason a tab was muted or unmuted. | ||
514 | tabs.PageSettings | API, Add-ons, Extensions, PageSettings, Reference, Type, WebExtensions, tabs |
The type tabs.PageSettings is used to control how the contents of a tab is printed. |
||
515 | tabs.TAB_ID_NONE | API, Add-ons, Extensions, Non-standard, Property, Reference, TAB_ID_NONE, WebExtensions, tabs |
A special ID value given to tabs that are not browser tabs (for example, tabs in devtools windows). | ||
516 | tabs.Tab | API, Add-ons, Extensions, Non-standard, Reference, Tab, Type, WebExtensions, tabs |
The type tabs.Tab contains information about a tab. This provides access to information about what content is in the tab, how large the content is, what special states or restrictions are in effect, and so forth. |
||
517 | tabs.TabStatus | API, Add-ons, Extensions, Non-standard, Reference, TabStatus, Type, WebExtensions, tabs |
Indicates whether the tab has finished loading. | ||
518 | tabs.WindowType | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, WindowType, tabs |
The type of window that hosts this tab. | ||
519 | tabs.ZoomSettings | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, ZoomSettings, tabs |
Defines zoom settings for a tab: mode , scope , and default zoom factor. |
||
520 | tabs.ZoomSettingsMode | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, ZoomSettingsMode, tabs |
Defines how zoom changes are handled. Extensions can pass this value into tabs.setZoomSettings() to control how the browser handles attempts to change zoom settings for a tab. Defaults to "automatic". |
||
521 | tabs.ZoomSettingsScope | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, ZoomSettingsScope, tabs |
Defines whether zoom changes will persist for the page's origin, or only take effect in this tab. This defaults to per-origin when tabs.zoomSettingsMode is "automatic", and is always per-tab otherwise. |
||
522 | tabs.captureVisibleTab() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, captureVisibleTab, tabs |
Creates a data URI encoding an image of the visible area of the currently active tab in the specified window. You must have the <all_urls> permission to use this method. |
||
523 | tabs.connect() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, connect, tabs |
Call this function to set up a connection between the extension's background scripts (or other privileged scripts, such as popup scripts or options page scripts) and any content scripts that belong to this extension and are running in the specified tab. This function returns a runtime.Port object. |
||
524 | tabs.create() | API, Add-ons, Create, Extensions, Method, Non-standard, Reference, WebExtensions, tabs |
Creates a new tab. | ||
525 | tabs.detectLanguage() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, detectLanguage, tabs |
Detects the primary language of the content in a tab, using the Compact Language Detector (CLD). | ||
526 | tabs.duplicate() | API, Add-ons, Duplicate, Extensions, Method, Non-standard, Reference, WebExtensions, tabs |
Duplicates a tab, given its ID. | ||
527 | tabs.executeScript() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, executeScript, tabs |
Injects JavaScript code into a page. | ||
528 | tabs.get() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, get, tabs |
Given a tab ID, get the tab's details as a tabs.Tab object. |
||
529 | tabs.getAllInWindow() | API, Add-ons, Deprecated, Extensions, Method, Non-standard, Reference, WebExtensions, getAllInWindow, tabs |
Gets details about all tabs in the specified window. | ||
530 | tabs.getCurrent() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getCurrent, tabs |
Get a tabs.Tab containing information about the tab that this script is running in. |
||
531 | tabs.getSelected() | API, Add-ons, Deprecated, Extensions, Method, Non-standard, Reference, WebExtensions, getSelected, tabs |
Gets the tab that is selected in the specified window. | ||
532 | tabs.getZoom() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getZoom, tabs |
Gets the current zoom factor for the specified tab. | ||
533 | tabs.getZoomSettings() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getZoomSettings, tabs |
Gets the current zoom settings for a specified tab. | ||
534 | tabs.highlight() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, highlight, tabs |
A Promise that will be fulfilled with a windows.Window object containing details about the window whose tabs were highlighted. If the window could not be found or some other error occurs, the promise will be rejected with an error message. |
||
535 | tabs.insertCSS() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, insertCSS, tabs |
Injects CSS into a page. | ||
536 | tabs.move() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, move, tabs |
Moves one or more tabs to a new position in the same window or to a different window. | ||
537 | tabs.onActivated | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onActivated, tabs |
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 tabs.onUpdated events to be notified when a URL is set. |
||
538 | tabs.onActiveChanged | API, Add-ons, Deprecated, Event, Extensions, Non-standard, Reference, WebExtensions, onActiveChanged, tabs |
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 to be notified when a URL is set. |
||
539 | tabs.onAttached | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onAttached, tabs |
Fired when a tab is attached to a window, for example because it was moved between windows. | ||
540 | tabs.onCreated | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onCreated, tabs |
Fired when a tab is created. | ||
541 | tabs.onDetached | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onDetached, tabs |
Fired when a tab is detached from a window, for example because it is being moved between windows. | ||
542 | tabs.onHighlightChanged | API, Add-ons, Deprecated, Event, Extensions, Non-standard, Reference, WebExtensions, onHighlightChanged, tabs |
Fired when the highlighted or selected tabs in a window changes. | ||
543 | tabs.onHighlighted | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onHighlighted, tabs |
Fired when the set of highlighted tabs in a window changes. | ||
544 | tabs.onMoved | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onMoved, tabs |
Fired when a tab is moved within a window. | ||
545 | tabs.onRemoved | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onRemoved, tabs |
Fired when a tab is closed. | ||
546 | tabs.onReplaced | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onReplaced, tabs |
Fired when a tab is replaced with another tab due to prerendering or instant. | ||
547 | tabs.onSelectionChanged | API, Add-ons, Deprecated, Event, Extensions, Non-standard, Reference, WebExtensions, onSelectionChanged, tabs |
Fires when the selected tab in a window changes. | ||
548 | tabs.onUpdated | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onUpdated, tabs |
Fired when a tab is updated. | ||
549 | tabs.onZoomChange | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onZoomChange, tabs |
Fired when a tab is zoomed. | ||
550 | tabs.query() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, query, tabs |
Gets all tabs that have the specified properties, or all tabs if no properties are specified. | ||
551 | tabs.reload() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, reload, tabs |
Reload a tab, optionally bypassing the local web cache. | ||
552 | tabs.remove() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, remove, tabs |
Closes one or more tabs. | ||
553 | tabs.removeCSS() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, removeCSS, tabs |
Removes from a page CSS which was previously injected by a call to tabs.insertCSS() . |
||
554 | tabs.sendMessage() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, sendMessage, tabs |
Sends a single message from the extension's background scripts (or other privileged scripts, such as popup scripts or options page scripts) to any content scripts that belong to the extension and are running in the specified tab. | ||
555 | tabs.sendRequest() | API, Add-ons, Deprecated, Extensions, Method, Non-standard, Reference, WebExtensions, sendRequest, tabs |
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. |
||
556 | tabs.setZoom() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, setZoom, tabs |
Zooms the specified tab. | ||
557 | tabs.setZoomSettings() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, setZoomSettings, tabs |
Sets zoom settings for the specified tab. These settings are reset to the default settings upon navigating the tab. | ||
558 | tabs.update() | API, Add-ons, Extensions, Method, Non-standard, Reference, Update, WebExtensions, tabs |
Navigate the tab to a new URL, or modify other properties of the tab. | ||
559 | theme | Extensions, Themes, WebExtensions, add-on |
Enables browser extensions to update the browser theme. | ||
560 | Theme | Extension, Theme, WebExtensisons, add-on |
A Theme object represents the specification of a theme. | ||
561 | update | Add-ons, Extensions, Theme, WebExtensions |
Updates the browser theme according to the content of theme object. | ||
562 | topSites | |
Use the topSites API to get an array containing all the sites listed in the browser's "New Tab" page. | ||
563 | topSites.MostVisitedURL | API, Add-ons, Extensions, MostVisitedURL, Non-standard, Reference, Type, WebExtensions, topSites |
The MostVisitedURL type contains two properties: the title of a page and its URL. |
||
564 | topSites.get() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, get, topSites |
Gets an array containing all the sites listed in the browser's "New Tab" page. | ||
565 | types | API, Add-ons, Extensions, Reference, Types, WebExtensions |
Defines the BrowserSetting type, which is used to represent a browser setting. |
||
566 | BrowserSetting | API, Add-ons, BrowserSetting, Extensions, Reference, Type, Types, WebExtensions |
A BrowserSetting is an object representing a browser setting. |
||
567 | clear() | |
Use BrowserSetting.clear() to clear any changes the extension has made to the browser setting. The browser setting will revert to its previous value. |
||
568 | get() | API, Add-ons, Extensions, Method, Reference, Types, WebExtensions, get |
The BrowserSetting.get() method gets the current value of the browser setting, and an enumeration indicating how the setting's value is currently controlled. |
||
569 | onChange | API, Add-ons, BrowserSetting, Event, Extensions, Privacy, Reference, WebExtensions, onchange |
The BrowserSetting.onChanged event is fired when the setting is changed. |
||
570 | set() | API, Add-ons, BrowserSetting, Extensions, Privacy, Reference, WebExtensions, set |
Use BrowserSetting.set() to change the browser setting to a new value. |
||
571 | webNavigation | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, webNavigation |
Add event listeners for the various stages of a navigation. A navigation consists of a frame in the browser transitioning from one URL to another, usually (but not always) in response to a user action like clicking a link or entering a URL in the location bar. | ||
572 | webNavigation.TransitionQualifier | API, Add-ons, Extensions, Non-standard, Reference, TransitionQualifier, Type, WebExtensions, webNavigation |
Values of this type are strings. Possible values are: | ||
573 | webNavigation.TransitionType | API, Add-ons, Extensions, Non-standard, Reference, TransitionType, Type, WebExtensions, webNavigation |
Cause of the navigation: for example, the user clicked a link, or typed an address, or clicked a bookmark. | ||
574 | webNavigation.getAllFrames() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getAllFrames, webNavigation |
Given a tab ID, retrieves information about all the frames it contains. | ||
575 | webNavigation.getFrame() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, getFrame, webNavigation |
Retrieves information about a particular frame. A frame may be the top-level frame in a tab or a nested iframe, and is uniquely identified by a tab ID and a frame ID. | ||
576 | webNavigation.onBeforeNavigate | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onBeforeNavigate, webNavigation |
Fired when the browser is about to start a navigation event. | ||
577 | webNavigation.onCommitted | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onCommitted, webNavigation |
Fired when a navigation is committed. At least part of the new document has been received from the server and the browser has decided to switch to the new document. | ||
578 | webNavigation.onCompleted | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onCompleted, webNavigation |
Fired when a document, including the resources it refers to, is completely loaded and initialized. This is equivalent to the DOM load event. |
||
579 | webNavigation.onCreatedNavigationTarget | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onCreatedNavigationTarget, webNavigation |
Fired when a new window, or a new tab in an existing window, is created to host the target of a navigation. For example, this event is sent when: | ||
580 | webNavigation.onDOMContentLoaded | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onDOMContentLoaded, webNavigation |
Fired when the DOMContentLoaded event is fired in the page. At this point the document is loaded and parsed, and the DOM is fully constructed, but linked resources such as images, stylesheets and subframes may not yet be loaded. | ||
581 | webNavigation.onErrorOccurred | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onErrorOccurred, webNavigation |
Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation. | ||
582 | webNavigation.onHistoryStateUpdated | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onHistoryStateUpdated, webNavigation |
Fired when the page used the history API to update the URL displayed in the browser's location bar. All future events for this frame will use the updated URL. | ||
583 | webNavigation.onReferenceFragmentUpdated | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onReferenceFragmentUpdated, webNavigation |
Events have three functions: | ||
584 | webNavigation.onTabReplaced | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onTabReplaced, webNavigation |
Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab. | ||
585 | webRequest | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, webRequest |
Add event listeners for the various stages of making an HTTP request. The event listener receives detailed information about the request, and can modify or cancel the request. | ||
586 | webRequest.BlockingResponse | API, Add-ons, BlockingResponse, Extensions, Non-standard, Reference, Type, WebExtensions, webRequest |
An object of this type is returned by event listeners that have set "blocking" in their extraInfoSpec argument. |
||
587 | webRequest.HttpHeaders | API, Add-ons, Extensions, HttpHeaders, Non-standard, Reference, Type, WebExtensions, webRequest |
An array of HTTP headers. Each header is represented as an object with two properties: name and either value or binaryValue . |
||
588 | webRequest.MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES | API, Add-ons, Extensions, MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES, Non-standard, Property, Reference, WebExtensions, webRequest |
The maximum number of times that can be called in a 10 minute period. |
||
589 | webRequest.RequestFilter | API, Add-ons, Extensions, Non-standard, Reference, RequestFilter, Type, WebExtensions, webRequest |
An object describing filters to apply to webRequest events. | ||
590 | webRequest.ResourceType | API, Add-ons, Extensions, Non-standard, Reference, ResourceType, Type, WebExtensions, webRequest |
This type is a string, which represents a particular kind of resource fetched in a web request. | ||
591 | webRequest.UploadData | API, Add-ons, Extensions, Non-standard, Reference, Type, UploadData, WebExtensions, webRequest |
Contains data uploaded in a URL request. | ||
592 | webRequest.handlerBehaviorChanged() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, handlerBehaviorChanged, webRequest |
Suppose an extension's job is to block web requests against a pattern, and the following scenario happens: | ||
593 | webRequest.onAuthRequired | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onAuthRequired, webRequest |
Fired when the server sends a 401 or 407 status code: that is, when the server is asking the client to provide authentication credentials such as a username and password. | ||
594 | webRequest.onBeforeRedirect | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onBeforeRedirect, webRequest |
Fired when a server-initiated redirect is about to occur. | ||
595 | webRequest.onBeforeRequest | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onBeforeRequest, webRequest |
This event is triggered when a request is about to be made, and before headers are available. This is a good place to listen if you want to cancel or redirect the request. | ||
596 | webRequest.onBeforeSendHeaders | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onBeforeSendHeaders, webRequest |
This event is triggered before sending any HTTP data, but after all HTTP headers are available. This is a good place to listen if you want to modify HTTP request headers. | ||
597 | webRequest.onCompleted | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onCompleted, webRequest |
Fired when a request has completed. | ||
598 | webRequest.onErrorOccurred | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onErrorOccurred, webRequest |
Fired when a request could not be processed due to an error: for example, a lack of Internet connectivity. | ||
599 | webRequest.onHeadersReceived | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onHeadersReceived, webRequest |
Fired when the HTTP response headers associated with a request have been received. You can use this event to modify HTTP response headers. | ||
600 | webRequest.onResponseStarted | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onResponseStarted, webRequest |
Fired when the first byte of the response body is received. | ||
601 | webRequest.onSendHeaders | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, onSendHeaders, webRequest |
This event is fired just before sending headers. If your extension or some other extension modified headers in , you'll see the modified version here. |
||
602 | windows | API, Add-ons, Extensions, Interface, Non-standard, Reference, WebExtensions, Windows |
Interact with browser windows. You can use this API to get information about open windows and to open, modify, and close windows. You can also listen for window open, close, and activate events. | ||
603 | windows.CreateType | API, Add-ons, CreateType, Extensions, Non-standard, Reference, Type, WebExtensions, Windows |
Specifies the type of browser window to create. | ||
604 | windows.WINDOW_ID_CURRENT | API, Add-ons, Extensions, Non-standard, Property, Reference, WINDOW_ID_CURRENT, WebExtensions, Windows |
The windowId for the current window. |
||
605 | windows.WINDOW_ID_NONE | API, Add-ons, Extensions, Non-standard, Property, Reference, WINDOW_ID_NONE, WebExtensions, Windows |
The windowId value that represents the absence of a browser window. |
||
606 | windows.Window | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, Window, Windows |
Information about a browser window. | ||
607 | windows.WindowState | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, WindowState, Windows |
The state of this browser window. | ||
608 | windows.WindowType | API, Add-ons, Extensions, Non-standard, Reference, Type, WebExtensions, WindowType, Windows |
The type of browser window this is. | ||
609 | windows.create() | API, Add-ons, Create, Extensions, Method, Non-standard, Reference, WebExtensions, Windows |
Creates a new window. | ||
610 | windows.get() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, Windows, get |
Gets details about a window, given its ID. The details are passed into a callback. | ||
611 | windows.getAll() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, Windows, getAll |
Gets information about all open windows, passing them into a callback. | ||
612 | windows.getCurrent() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, Windows, getCurrent |
Gets the current browser window, passing its details into a callback. | ||
613 | windows.getLastFocused() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, Windows, getLastFocused |
Gets the window that was most recently focused — typically the window 'on top' — and passes it into a callback. | ||
614 | windows.onCreated | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, Windows, onCreated |
Fired when a window is created. | ||
615 | windows.onFocusChanged | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, Windows, onFocusChanged |
Fired when the currently focused window changes. Will be windows.WINDOW_ID_NONE if all browser windows have lost focus. |
||
616 | windows.onRemoved | API, Add-ons, Event, Extensions, Non-standard, Reference, WebExtensions, Windows, onRemoved |
Fired when a window is closed. | ||
617 | windows.remove() | API, Add-ons, Extensions, Method, Non-standard, Reference, WebExtensions, Windows, remove |
Closes a window and all the tabs inside it, given the window's ID. | ||
618 | windows.update() | API, Add-ons, Extensions, Method, Non-standard, Reference, Update, WebExtensions, Windows |
Updates the properties of a window. Use this to move, resize, and (un)focus a window, etc. | ||
619 | Match patterns | WebExtensions |
Match patterns are a way to specify groups of URLs: a match pattern matches a specific set of URLs. They are for extensions using WebExtensions APIs in a few places, most notably to specify which documents to load content scripts into, and to specify which URLs to add webRequest listeners to. |
||
620 | Modify a web page | WebExtensions |
One of the most common use cases for an extension is to modify a web page. For example, an extension might want to change the style applied to a page, hide particular DOM nodes, or inject extra DOM nodes into the page. | ||
621 | Native messaging | WebExtensions |
Native messaging enables an extension to exchange messages with a native application installed on the user's computer. This enables native applications to provide a service to extensions without needing to be reachable over the web. One common example here is password managers: the native application manages storage and encryption of passwords, and communicates with the extension to populate web forms. Native messaging also enables extensions to access resources that are not accessible through WebExtension APIs, such as some particular piece of hardware. | ||
622 | Porting a Google Chrome extension | WebExtensions |
Extensions developed with WebExtension APIs are designed for cross-browser compatibility: to a large extent the technology is compatible with the extension API supported by Google Chrome and Opera. Extensions written for these browsers will in most cases run in Firefox with just a few changes. The process of porting an extension from Chrome or Opera is like this: | ||
623 | Porting a legacy Firefox extension | WebExtensions |
If you have developed a Firefox extension using XUL/XPCOM or the Add-on SDK, this page will help you migrate your extension to use WebExtensions APIs. The standard to build extensions for Firefox is to use | ||
624 | Prerequisites | |
All you need is Firefox 45 or higher. See Your first extension to get started. | ||
625 | Publishing your extension | WebExtensions |
Once you've finished writing and testing your extension, you'll probably want to share it with other people. Mozilla operates a website: addons.mozilla.org (commonly abbreviated to AMO), where developers can publish add-ons and users can find them. By publishing your extension on AMO, you can participate in our community of users and creators, and find an audience for your extension. | ||
626 | Temporary installation in Firefox | WebExtensions |
To install an extension temporarily: | ||
627 | Tips and Tricks | |
This page contains various tips and tricks which should be useful to many people developing extensions using WebExtension APIs. | ||
628 | User interface | Landing, User Interface, WebExtensions |
Extensions that use WebExtension APIs are provided with several user interface options so that their functionality can be made available to the user. A summary of those options is provided below, with a more detailed introduction to each user interface option in this section. | ||
629 | Address bar button | User Interface, WebExtensions |
Commonly referred to as a page action, this user interface option is a button added to the browser address bar. Users click the button to interact with your extension. | ||
630 | Address bar suggestions | User Interface, WebExtensions |
Using the omnibox API, extensions can customize the suggestions offered in the browser address bar's drop-down when the user enters a keyword. |
||
631 | Browser styles | Add-ons, Extensions, WebExtensions |
Certain user interface components - browser and page action popups, sidebars, and options pages - are specified by your extension in essentially the same way: | ||
632 | Bundled web pages | |
You can include web pages in your extension to provide forms, help, or any other content your extension needs. | ||
633 | Context menu items | WebExtensions |
No summary! | ||
634 | Notifications | WebExtensions |
No summary! | ||
635 | Options page | WebExtensions |
No summary! | ||
636 | Popups | User Interface, WebExtensions |
No summary! | ||
637 | Sidebars | WebExtensions |
No summary! | ||
638 | Toolbar button | WebExtension |
Commonly referred to as a browser action, this user interface option is a button added to the browser toolbar. Users click the button to interact with your extension. |
||
639 | devtools panels | Beginner, Guide, User Interface, WebExtensions |
When an extension provides tools that are of use to developers, it's possible to add a UI for them to the browser's developer tools as a new panel. | ||
640 | What are extensions? | WebExtensions |
Extensions are bits of code that modify the functionality of a web browser. They are written using standard Web technologies - JavaScript, HTML, and CSS - plus some dedicated JavaScript APIs. Among other things, extensions can add new features to the browser or change the appearance or content of particular websites. | ||
641 | Working with files | Guide, WebExtensions |
Your browser extension may need to work with files to deliver its full functionality. This article looks at the five mechanisms you have for handling files: | ||
642 | Your first extension | Guide, WebExtensions |
In this article we'll walk through creating an extension for Firefox, from start to finish. The extension just adds a red border to any pages loaded from "mozilla.org" or any of its subdomains. | ||
643 | Your second extension | WebExtensions |
No summary! | ||
644 | manifest.json | Add-ons, Extensions, WebExtensions |
The manifest.json file is a JSON-formatted file, and is the only file that every extension using WebExtension APIs must contain. | ||
645 | applications | Add-ons, Extensions, WebExtensions |
The applications key contains keys that are specific to a particular host application. |
||
646 | author | Add-ons, Extensions, WebExtensions |
The extension's author, intended for display in the browser's user interface. If the developer key is supplied and it contains the "name" property, it will override the author key. There's no way to specify multiple authors. | ||
647 | background | Add-ons, Extensions, WebExtensions |
Use the background key to include one or more background scripts, and optionally a background page in your extension. |
||
648 | browser_action | Add-ons, Extensions, WebExtensions |
A browser action is a button that your extension adds to the browser's toolbar. The button has an icon, and may optionally have a popup whose content is specified using HTML, CSS, and JavaScript. | ||
649 | chrome_settings_overrides | Add-ons, Extensions, WebExtensions, chrome_settings_overrides, manifest.json |
Use the chrome_settings_overrides key to override certain browser settings. Two settings are available: |
||
650 | chrome_url_overrides | Add-ons, Extensions, WebExtensions |
Use the chrome_url_overrides key to provide a custom replacement for the documents loaded into various special pages usually provided by the browser itself. |
||
651 | commands | Add-ons, Extensions, WebExtensions |
Use the commands key to define one or more keyboard shortcuts for your extension. |
||
652 | content_scripts | Add-ons, Extensions, WebExtensions |
Instructs the browser to load content scripts into web pages whose URL matches a given pattern. | ||
653 | content_security_policy | Add-ons, Extensions, WebExtensions |
Extensions have a content security policy applied to them by default. The default policy restricts the sources from which they can load<script> and <object> resources, and disallows potentially unsafe practices such as the use of eval() . See Default content security policy to learn more about the implications of this. |
||
654 | default_locale | Add-ons, Extensions, WebExtensions |
This key must be present if the extension contains the _locales directory, and must be absent otherwise. It identifies a subdirectory of _locales, and this subdirectory will be used to find the default strings for your extension. | ||
655 | description | Add-ons, Extensions, WebExtensions |
A short description of the extension, intended for display in the browser's user interface. | ||
656 | developer | Add-ons, Extensions, WebExtensions |
The name of the extension's developer and their homepage URL, intended for display in the browser's user interface. | ||
657 | devtools_page | |
Use this key to enable your extension to extend the browser's built-in devtools. | ||
658 | homepage_url | Add-ons, Extensions, WebExtensions |
URL for the extension's home page. | ||
659 | icons | Add-ons, Extensions, WebExtensions |
The icons key specifies icons for your extension. Those icons will be used to represent the extension in components such as the Add-ons Manager. |
||
660 | incognito | Add-ons, WebExtensions, incognito, manifest.json |
Use the incognito key to control how the extension works with private browsing windows. |
||
661 | manifest_version | Add-ons, Extensions, WebExtensions |
This key specifies the version of manifest.json used by this extension. | ||
662 | name | Add-ons, Extensions, WebExtensions |
Name of the extension. This is used to identify the extension in the browser's user interface and on sites like addons.mozilla.org. | ||
663 | omnibox | Add-ons, Extensions, WebExtensions |
Use the omnibox key to define an omnibox keyword for your extension. |
||
664 | optional_permissions | Add-ons, WebExtensions, manifest.json, optional_permissions |
Use the optional_permissions key to list permissions which you want to ask for at runtime, after your extension has been installed. |
||
665 | options_ui | Add-ons, Extensions, WebExtensions |
Use the options_ui key to define an options page for your extension. |
||
666 | page_action | Add-ons, Extensions, WebExtensions |
A page action is an icon that your extension adds inside the browser's URL bar. | ||
667 | permissions | Add-ons, Extensions, WebExtensions |
Use the permissions key to request special powers for your extension. This key is an array of strings, and each string is a request for a permission. |
||
668 | protocol_handlers | Add-ons, Extensions, WebExtensions, manifest.json |
Use this key to register one or more web-based protocol handlers. | ||
669 | short_name | Add-ons, Extensions, WebExtensions |
Short name for the extension. If given, this will be used in contexts where the name field is too long. It's recommended that the short name should not exceed 12 characters. If the short name field is not included in manifest.json, then name will be used instead and may be truncated. | ||
670 | sidebar_action | WebExtensions |
A sidebar is a pane that is displayed at the left-hand side of the browser window, next to the web page. The browser provides a UI that enables the user to see the currently available sidebars and to select a sidebar to display. | ||
671 | theme | Add-ons, Themes |
Use the theme key to define a static theme to apply to Firefox. | ||
672 | version | Add-ons, Extensions, WebExtensions |
Version of the extension, formatted as numbers and ASCII characters separated by dots. For the details of the version format, see the Version format page. | ||
673 | web_accessible_resources | Add-ons, Extensions, WebExtensions |
Sometimes you will want to package some resources - for example, images, HTML, CSS, or JavaScript - with your extension, and make them available to web pages. | ||
674 | web-ext command reference | Options, Reference, Tools, WebExtensions, commands, web-ext |
This page lists all the commands and options available under the web-ext command line tool. | ||
675 | Code snippets | Add-ons, Code snippets, Extensions |
676 | Alerts and Notifications | Code snippets |
non-modal notification and further interaction with users | ||
677 | Autocomplete | Code snippets, Form Fill, Satchel |
678 | Bookmarks | Code snippets, Developing Mozilla, Extensions, Places |
679 | Boxes | Code snippets |
Make the BOX style="display: block" and the wrapping behavior will occur when the box is resized: |
||
680 | Canvas code snippets | Canvas, Code snippets, Graphics |
681 | Cookies | Add-ons, Code snippets, Cookies, Extensions |
682 | Customizing the download progress bar | |
683 | Delayed Execution | Code snippets |
684 | Dialogs and Prompts | Add-ons, Code snippets, Extensions, XUL |
685 | Downloading Files | Code snippets |
To download a file, create an instance of nsIWebBrowserPersist and call its nsIWebBrowserPersist.saveURI() method, passing it a URL to download and an nsIFile instance representing the local file name/path. |
||
686 | Drag & Drop | Code snippets |
687 | Embedding SVG | Code snippets |
688 | Examples and demos from articles | |
689 | File I/O | Add-ons, Code snippets, Extensions, Files, Streams, Tutorial |
690 | Finding window handles | Add-ons, Code snippets, Extensions, XPCOM, js-ctypes |
691 | Forms related code snippets | Code snippets, Forms |
692 | HTML in XUL for rich tooltips | Code snippets, Examples, HTML, XUL |
693 | HTML to DOM | Code snippets, DOM, Guide, HTML, Intermediate, NeedsUpdate |
694 | IsDefaultNamespace | |
695 | JS XPCOM | Code snippets, JavaScript, XPCOM, about:, nsIAboutModule |
696 | JavaScript Debugger Service | Code snippets |
697 | JavaScript timers | JavaScript timers, NeedsBetterPlace |
698 | JavaScript Daemons Management | DOM, Guide, JavaScript, JavaScript timers, MakeBrowserAgnostic |
699 | Label and description | Code snippets |
700 | LookupNamespaceURI | |
701 | LookupPrefix | |
702 | Miscellaneous | Add-ons, Code, Code snippets, Extensions, Snippets |
703 | Modules | |
704 | On page load | Add-ons, Extensions |
705 | Page Loading | Code snippets |
706 | Post data to window | Add-ons, Extensions, NeedsContent |
707 | Preferences | Add-ons, Code snippets, Extensions, Guide, Mozilla, Preferences |
708 | Progress Listeners | Add-ons, Extensions |
709 | QuerySelector | DOM |
No summary! | ||
710 | Rosetta | C, DOM, HTML, HTMLScriptElement, JavaScript, Non-JavaScript, Programming Languages |
711 | Running applications | Add-ons, Code snippets, Extensions |
712 | SVG Animation | NeedsContent |
713 | SVG General | Code snippets |
714 | Scrollbar | Code snippets |
715 | Sidebar | Add-ons, Code snippets, Extensions |
716 | StringView | Code snippet, Guide, JavaScript, JavaScript typed arrays, MDN JavaScript Libraries, Sample code, Typed Arrays, WebGL, WebSockets, js-ctypes |
717 | Tabbox | |
Assuming the tabbox, tabs, and tabpanels widgets with id's the same as their nodeName, this function will correctly remove the current tab and tab panel for the onclosetab tabs event: | ||
718 | Toolbar | Add-ons, Code snippets, Extensions, Toolbars |
719 | Tree | Code snippets |
720 | URI parsing | |
721 | View Source for XUL Applications | |
722 | Windows | Add-ons, Code snippets, Extensions, Guide, NeedsContent, NeedsHelp |
723 | XML-related code snippets | Add-ons, Code snippets, Extensions |
724 | xml:base support in old browsers | Code snippets |
725 | XPath | |
726 | getAttributeNS | Code snippets |
727 | Creating OpenSearch plugins for Firefox | Add-ons, Guide, OpenSearch, Search, Search plugins |
Firefox supports the OpenSearch description format for search plugins. OpenSearch plugins are also compatible with Internet Explorer, Safari, and Chrome. | ||
728 | Creating an appealing add-on listing | Add-ons, Beginner, Guide, WebExtension, publishing |
There are two essential steps to getting people to use your add-on: they need to discover your add-on and open the listing page, then the listing page needs to encourage them to click the Add to Firefox button. The content you add to a listing is therefore vital: from making effective use of keywords in your descriptions, to get visibility in external search engine results, through having an icon that attracts a user’s attention from a category list, to screenshots that show how useful your add-on is. | ||
729 | Creating custom Firefox extensions with the Mozilla build system | Add-ons, Build documentation, Developing Mozilla, Extensions, Guide, NeedsContent, XPCOM |
There is a wealth of material on creating extensions for Firefox. All of these documents currently assume, however, that you are developing your extension using XUL and JavaScript only. For complex extensions, it may be necessary to create components in C++ that provide additional functionality. Reasons why you might want to include C++ components in your extension include: | ||
730 | Extension Etiquette | Add-ons, Extensions, Guide |
This article describes best practices when making extensions, including how to be kind to your users. It assumes that you are already familiar with Building an Extension. | ||
731 | Extension Packaging | Add-ons, Extensions, Guide, Toolkit API |
By the end of 2017 WebExtensions will be the only supported add-on type in Firefox. To learn how to install a WebExtension for testing purposes, see Temporary Installation in Firefox. To learn how to package a WebExtension for distribution, see Publishing your WebExtension. | ||
732 | Extensions support in SeaMonkey 2 | Add-ons, CodingScripting, Extensions, JavaScript, SeaMonkey, URL, add-ons, thunderbird |
Starting with SeaMonkey 2 Alpha 1 SeaMonkey supports toolkit/-style extensions. These type of extensions have many advantages for both users and developers compared to the old xpinstall/-style extensions. | ||
733 | Hotfix Extension | |
This document has been moved to the Add-ons wiki. | ||
734 | How to convert an overlay extension to restartless | Add-ons, Code snippets, Extensions, Firefox, Firefox OS, Guide, Preferences system |
First off, what kind of add-on are we talking about here? Well, XUL overlays and windows, JSM files, chrome & resource mappings with localization, default preferences, but no XPCOM components of your own. Some of that will have to be replaced and the rest will need to be loaded differently. | ||
735 | Index | Add-ons, Glossary, Guide, Index |
Found 886 pages: | ||
736 | Inline options | Add-ons, Extensions, XUL |
Firefox 7 supports a new syntax for defining extensions' preferences for both bootstrapped and traditional extensions. The user interface for the preferences defined with this new syntax appears in the extension's detail view in the Add-on Manager. This functionality originally appeared in Firefox mobile and is now available in Firefox on the desktop as well. | ||
737 | Install Manifests | Add-ons, Extensions, Manifests, NeedsUpdate, Toolkit API |
An Install Manifest is the file an Add-on Manager-enabled XUL application (e.g. Firefox or Thunderbird) uses to determine information about an add-on as it is being installed. It contains metadata identifying the add-on, providing information about who created it, where more information can be found about it, which versions of what applications it is compatible with, how it should be updated, and so on. | ||
738 | Installing extensions | Add-ons, Extensions, Guide |
If you are developing a native tool or application which ships with an associated extension for toolkit-based application, such as Firefox, your native tool can initiate the extension installation by copying the extension into a predefined directory on the user's computer. The next time that the toolkit-based application (Firefox) is launched, the user will be asked to approve of the installation, and if the user approves, the extension will be automatically loaded for subsequent launches. If the user has more than one profile, the approval and installation will occur on the next launch of each profile. | ||
739 | Interfacing with the Add-on Repository | AMO, Add-on Manager, Add-ons |
The Add-on Repository JavaScript code module makes it easy for your extension to interface with the AMO repository. You an use the code module to get lists of add-ons and even install new add-ons. This article provides some sample code that queries the recommended add-ons list on AMO and lets the user click a button to install an add-on from the list. | ||
740 | Legacy Add-ons | Add-ons, Extensions, Landing |
This section contains links to documentation for legacy technology for add-on development, including: | ||
741 | Legacy extensions for Firefox for Android | |
Add-ons that work with desktop Firefox do not automatically work in Firefox for Android: | ||
742 | API | |
There are a couple of differences between desktop Firefox and Firefox for Android that are particularly relevant to add-on developers: | ||
743 | Accounts.jsm | |
The Accounts API lets you check whether a Firefox Account or a legacy Sync account is currently present on the device, and to start the Firefox Account set-up process if an account is not present. Accounts is a single object that provides a Promise-based API. |
||
744 | BrowserApp | Apps, CodingScripting, Firefox, Glossary, Guide, Mobile, add-on |
Add-ons running on desktop Firefox can use the global gBrowser variable to interact with tabs and any HTML content they host. This object isn't available on Firefox for Android, and instead add-ons should use the BrowserApp object, which provides much of the same functionality. |
||
745 | addTab | |
BrowserApp.addTab() opens a new tab. By default, the new tab is made the selected tab. |
||
746 | closeTab | |
BrowserApp.clo seTab(tab) closes the supplied tab. If no other tabs are open, then the tab is not closed. |
||
747 | deck | |
deck is a property of the BrowserApp object. It is a deck of all currently open browsers, represented as browser objects. |
||
748 | getBrowserForDocument | |
BrowserApp.getBrowserForDocument() retrieves a browser , given the DOM document hosted by that browser. |
||
749 | getBrowserForWindow | |
BrowserApp.getBrowserForWindow() retrieves a browser , given the DOM content window hosted by that browser. |
||
750 | getTabForBrowser | |
BrowserApp.getTabForBrowser() retrieves a tab, given the XUL browser object hosted by that tab. |
||
751 | getTabForId | |
BrowserApp.getTabForId() retrieves a browser tab, given its unique ID. |
||
752 | getTabForWindow | |
BrowserApp.getTabForWindow() retrieves a browser tab, given the DOM window hosted by that tab. |
||
753 | loadURI | |
BrowserApp.loadURI (uri, browser, params) loads the specified URI into the specified browser . |
||
754 | quit | Apps, Firefox, Mobile, NeedsContent |
BrowserApp.quit() closes the browser. |
||
755 | selectTab | Mobile, NeedsContent, Reference, Référence |
BrowserApp.selectTab (tab) makes the supplied tab the currently selected tab. |
||
756 | tabs | Apps, CodingScripting, Firefox, JavaScript, Mobile |
tabs is a property of the BrowserApp object. It is an Array of all currently open tabs, represented as Tab objects. |
||
757 | HelperApps.jsm | |
|
||
758 | Home.jsm | |
The Home.jsm JavaScript code module offers utility routines dealing with customizing the home page in Fennec. This is the page that's shown on startup and new tabs, as well as when the user enters "editing mode" from the urlbar. To use it, you first need to import the code module into your JavaScript scope: |
||
759 | banner | API, Glossary, Guide, JavaScript |
The Home.banner API lets you customize a banner that appears at the bottom of the home page. You can use this API to add and remove messages from the set of messages that rotate through this banner. |
||
760 | panels | API, CodingScripting, Firefox, Glossary, Guide, JavaScript, Mobile, add-on |
Use the Home.panels API to add custom panels to the browser's home page. |
||
761 | HomeProvider.jsm | |
The HomeProvider API lets you store data that can be displayed in custom panels on the home page. HomeProvider is a single object that manages access to data and data syncing. |
||
762 | HomeStorage | |
Each HomeStorage object is associated with a single dataset. This object is used to save and delete data. Consumers can retreive a HomeStorage object through the HomeProvider API. |
||
763 | NativeWindow | |
The NativeWindow object enables Firefox for Android add-ons to create user interface components. |
||
764 | contextmenus | API, Reference, Référence |
Returns a reference to the NativeWindow.contextmenus object, which can be used to add items to the Firefox for Android context menu, and subsequently remove them. You can add a menu item to the context menu using NativeWindow.contextmenus.add() and remove it using NativeWindow. contextmenus .remove() . |
||
765 | add | API, CodingScripting, Firefox, Guide, JavaScript, Mobile, add-on |
NativeWindow.contextmenus.add() adds a new context menu item to Firefox for Android. |
||
766 | remove | API, CodingScripting, Firefox, JavaScript, Mobile, add-on |
NativeWindow.contextmenus.add() adds an item to the context menu in Firefox for Android, returning an ID for the item. To remove the item, use NativeWindow.contextmenus.remove() , passing in the item's ID. |
||
767 | doorhanger | Add-ons, Extensions, Mobile, Reference, Référence |
Returns a reference to the NativeWindow.doorhanger object, which can be used to display doorhanger notifications (also known as popup notifications) on Firefox for Android. |
||
768 | menu | API, Reference, Référence |
Returns a reference to the NativeWindow.menu object, which can be used to add items to the main Firefox for Android menu, and subsequently remove them. You can add a menu item to a browser window using NativeWindow.menu.add() and remove it using NativeWindow.menu.remove() . |
||
769 | add | NativeWindow, Reference, Référence, menu |
NativeWindow.menu.add() adds a new item to the main menu in Firefox for Android. By specifying an optional parent attribute, a menu item can be added to the submenu of the parent. |
||
770 | remove | |
NativeWindow.menu.add() adds an item to the main menu in Firefox for Android, returning an ID for the item. To remove the item, use NativeWindow.menu.remove() , passing in the item's ID. |
||
771 | update | Extensions, Fiferox for Android, NativeWindow |
NativeWindow.menu.add() adds an item to the main menu in Firefox for Android, returning an ID for the item. To update the item, use NativeWindow.menu.update() , passing in the item's ID and a set of attributes to update. |
||
772 | toast | Add-ons, CodingScripting, Firefox, Guide, JavaScript, Mobile |
Returns a reference to the NativeWindow.toast object, which can be used to display toast notifications on Firefox for Android. |
||
773 | show | API, Add-ons, CodingScripting, Firefox, Glossary, Guide, JavaScript, Mobile, toast |
NativeWindow.toast.show() displays a toast notification on Firefox for Android. |
||
774 | Notifications.jsm | |
The Notifications .jsm JavaScript code module offers utility routines dealing with showing system notifications in Fennec. It duplicates some of what is available in the nsIAlertService already, but exposes to more advanced Android functionality. |
||
775 | PageActions.jsm | |
Contains the PageActions object, which can be used to add items to the Firefox for Android url/title bar, and subsequently remove them. You can add an item using PageActions.add() and remove it using PageActions.remove() . Import the script by inserting: |
||
776 | Prompt.jsm | |
|
||
777 | RuntimePermissions.jsm | |
Contains the RuntimePermissions object, which can be used to check whether one or more runtime permissions have been granted to Firefox for Android, and to ask for them if they have not. |
||
778 | Snackbars.jsm | |
Contains the Snackbars object, which can be used to show notifications to let users know that some change has been made. | ||
779 | Sound.jsm | |
The Sound.jsm JavaScript code module offers the ability to play sounds simply using the HTML 5 audio APIs under the hood. For basic usage, see the Github readme. |
||
780 | Tab | API, Add-ons, CodingScripting, Firefox, Mobile, Tab |
The Tab object represents a browser tab, and provides access to the browser and the DOM content window hosted by that tab. |
||
781 | Addons developer guide | install, xpi |
This guide walks you through the steps needed to make a restartless add-on for Firefox on Android. If you are familiar with building add-ons for desktop Firefox, much of this guide will be review. Firefox on Android uses native Android widgets for the browser UI so the big difference is how you interact with the browser UI. | ||
782 | Code snippets | |
This article includes code snippets to help you write an add-on for Firefox for Android. For additional code samples, check out the Firefox for Android Add-ons Github repo. | ||
783 | Creating a User Interface | |
See the NativeWindow documentation for examples the APIs Firefox for Android add-ons can use to create user interface components. |
||
784 | Firefox Hub Walkthrough | |
This guide walks you through developing a Firefox Hub add-on for Firefox for Android. The Firefox Hub APIs allow add-ons to add new content to the Firefox for Android home page. These APIs are new in Firefox 30, and increased capabilities are planned for future releases. The two main APIs that this guide covers are the Home.panels API and the HomeProvider API. For some example code to get started, you can copy the hub boilerplate add-on from github. |
||
785 | Initialization and Cleanup | |
Android add-ons don't have to be restartless, but with Firefox for Android you can't use XUL overlays to create your user interface, so there's much less incentive to write overlay-based add-ons. | ||
786 | Prerequisites | Extensions, Mobile |
While you're developing your add-on, it will be very important to have a way to test and run snippets of code; development will go very slowly if you have to build and install your entire app every time you need to test something. Once all of your snippets are working together, then you can start worrying about bringing together all of the add-on files to build the complete app (bootstrap.js, etc.). You can do this using WebIDE, by connecting your device to your development workstation. | ||
787 | Walkthrough | Extensions, Mobile |
This guide walks you through the process of developing a simple add-on for Firefox for Android. The add-on adds a menu item to display the source of the current web page. If you're familiar with developing add-ons for desktop Firefox, much of this guide will not be new to you. |
||
788 | WebExtensions for Firefox for Android | Landing, Mobile, WebExtensions |
This section provides information specific to developing extensions using WebExtension APIs for Firefox for Android. General information on extensions development is in main extensions section. If you have not developed extensions before, consider starting with the guides to building extensions for desktop, such as the guide to building Your first extension. | ||
789 | Overlay extensions | Add-ons, Extensions, Landing |
This page contains links to documentation for the approach to developing extensions for Gecko-based applications which uses: | ||
790 | Firefox addons developer guide | Add-ons, Extensions, Firefox, Guide |
The Firefox add-ons developer guide was contributed by the Mozilla Japan community; it covers how to go about building Firefox extensions using XPCOM and XUL. These days, we recommend using the Add-on SDK instead, but there are times when you need the additional control offered by a more direct approach. | ||
791 | Appendix: What you should know about open-source software licenses | |
No summary! | ||
792 | Chapter 1: Introduction to Extensions | |
This document was authored by Hideyuki Emura and was originally published in Japanese for the Firefox Developers Conference Summer 2007. Emura-san is a co-author of Firefox 3 Hacks (O'Reilly Japan, 2008.) | ||
793 | Chapter 2: Technologies used in developing extensions | |
This document was authored by Hiroshi Shimoda of Clear Code Inc. and was originally published in Japanese for the Firefox Developers Conference Summer 2007. Shimoda-san is a co-author of Firefox 3 Hacks (O'Reilly Japan, 2008). | ||
794 | Chapter 3: Introduction to XUL—How to build a more intuitive UI | Firefox, XUL |
learn about XUL, the XML-based User-interface Language, which is one of the building blocks for extensions. | ||
795 | Chapter 4: Using XPCOM—Implementing advanced processes | |
This chapter explains how to use XPCOM to implement advanced processes using only JavaScript. | ||
796 | Chapter 5: Let's build a Firefox extension | Archive, Obsolete |
This document was authored by Taiga (Gomita) Gomibuchi and was originally published in Japanese for the Firefox Developers Conference Summer 2007. Gomita-san won "Most Useful Upgraded Extension" award in Mozilla's 2006 "Extend Firefox" competition for ScrapBook, and was runner-up in the "Extend Firefox 2" contest for FireGestures. | ||
797 | Chapter 6: Firefox extensions and XUL applications | |
This chapter discusses tools to assist in developing extensions. | ||
798 | License and authors | |
License: Attribution-Share Alike 2.1 Japan. | ||
799 | XUL School Tutorial | Add-ons, Extensions, References, Tutorials, XUL |
XUL School is a comprehensive add-on development tutorial, focusing on Firefox extension development. It is recommended that you read through all of it at least once. While Firefox changes rapidly, the content in this tutorial should be up to date and valid. | ||
800 | Adding Events and Commands | Add-ons, CodingScripting, DOM, Glossary, Guide, JavaScript, XUL, events |
Just like with HTML, most JavaScript code execution is triggered by event handlers attached to DOM elements. The most commonly used event is the onload event, which is used in overlays and other windows to detect when the window has loaded and then run initialization code: | ||
801 | Adding Toolbars and Toolbar Buttons | Toolbars, XUL |
Adding new toolbars to Firefox is easy, but adding them the wrong way is very easy as well. | ||
802 | Adding menus and submenus | Add-ons, CodingScripting, Macs, XUL, apple |
The Hello World example in the previous sections shows the two most common ways to add menus. In this section we'll look into more specialized menus and what you can do with them. | ||
803 | Adding sidebars | |
The sidebar in Firefox is a relatively large and flexible space to add rich interfaces without requiring new windows or complicated overlays. Sidebars take as much space as the user wants them to, and provide a frame where you can add elaborate data and controls. You're probably familiar with the Bookmarks and History sidebars. If not, you can open either one from the View > Sidebar menu. They also have shortcuts to open or close them using the keyboard. | ||
804 | Adding windows and dialogs | |
To open a new window, use the Javascript window.open function just like with HTML windows. | ||
805 | Appendix A: Add-on Performance | Add-ons, Extensions, Performance |
Add-ons can have a noticeable performance impact on Firefox. This is evident when opening a Firefox profile that has many add-ons installed; some profiles can take minutes to load, which is a serious inconvenience for users that gives them a negative view of Firefox. Add-on developers need to make sure that they minimize their add-ons' performance impact, and here are a few simple guidelines that should be followed to achieve that. | ||
806 | Appendix B: Install and Uninstall Scripts | |
Add-ons normally run code at startup, and as it is covered in the main tutorial, all you need is a load event handler and a little code. It is also common for an add-on to require to run a script only when it is installed for the first time, or every time it is updated. It can be used to write or copy necessary files to the profile folder, like the initial DB the add-on will use for storage. A few others require cleanup code to be run after the add-on is uninstalled. This appendix covers these cases with simple code that should work for most add-ons. | ||
807 | Appendix C: Avoiding using eval in Add-ons | |
Using eval in add-ons is almost always unnecessary, and many times even a security vulnerability. Moreover, code using eval is harder to parse for a human mind, is often pretty complex, and relies on assumptions that are not necessarily true in the future or even now. |
||
808 | Appendix D: Loading Scripts | Extensions, XUL |
Most add-ons and XUL Runner applications provide their primary functionality by loading and executing JavaScript code. Because there are such a diverse array of add-ons, and because the needs of developers have grown organically over time, the Gecko runtime provides a number of means to dynamically load and execute JavaScript files. Each of these means has its own advantages and disadvantages, as well as its own quirks which may trap the unwary. Below is an overview of the more common means of loading scripts, along with some of their primary advantages, disadvantages, quirks, and use cases. | ||
809 | Appendix E: DOM Building and Insertion (HTML & XUL) | |
Many add-ons need to dynamically generate DOM content, either XUL or HTML, from their scripts. For security reasons, and to prevent errors, care needs to be taken to avoid evaluating arbitrary text as HTML. Failure to do so can lead to execution or remote scripts, and in the worst cases to privilege escalation which can leave a user's PC open to remote attack. | ||
810 | Appendix F: Monitoring DOM changes | |
DOM mutation events were introduced to HTML several years ago in order to allow web applications to monitor changes to the DOM by other scripts. Unfortunately, adding listeners for any of these events to a document has a highly deleterious effect on performance, an effect which is not mitigated in the slightest by later removing those listeners. For this reason, it is best to avoid using mutation listeners at all costs, especially from extensions. This document lays out some alternatives which do not have such severe performance impacts. | ||
811 | Connecting to Remote Content | |
XMLHttpRequest is an API for transferring XML between a local script and a remote server via HTTP. It is an integral part of the modern web, and all major browsers support it. Besides XML, it can be used to retrieve data in other formats, for example JSON, HTML and plain text. In this section we'll look into the XML and JSON communication mechanisms. | ||
812 | Custom XUL Elements with XBL | |
Taken from the XBL page. | ||
813 | Getting Started with Firefox Extensions | Extensions |
an extension is a small application that adds something new to one or more Mozilla applications. This tutorial focuses on extensions for Firefox, but the same (or very similar) principles apply to creating extensions for other applications such as Thunderbird, Seamonkey, and Flock. | ||
814 | Handling Preferences | Add-ons, Extensions, XUL, XUL School |
Mozilla applications are highly customizable. Preferences are used to store settings and information to change their default behavior. To open the preferences window in Firefox, select the following from the main menu: | ||
815 | Intercepting Page Loads | |
There are several ways to detect and intercept loading of web pages and their content, be it only to realize when it happens, modify their contents, or to block them and do something else instead. Some of the techniques presented here apply only to content loaded in the main browser area, while others detect content being loaded in other XUL windows, or even detect XUL content being loaded. Also, the different techniques tap into different steps of the load process. Which one you should use solely depends on your needs. We will start with the simplest one, which is also the most common to use. | ||
816 | Introduction | |
Welcome to the XUL School Tutorial! | ||
817 | JavaScript Object Management | JavaScript, Object, Tutorials |
In this section we'll look into how to handle JavaScript data effectively, beginning with chrome code, in ways which will prevent pollution of shared namespaces and conflicts with other add-ons resulting from such global namespace pollution. | ||
818 | Local Storage | Guide, Storage, XUL |
It is very common for an extension to require some kind of local persistent storage. We recommend that you at least keep an error log, so that you can request error data from your users when you encounter problems that are hard to debug. We'll discuss logging in this section, but first let's look at the right (or at least, common and scalable) way of managing local files. | ||
819 | Mozilla Documentation Roadmap | |
Firefox extension development is still an immature discipline, with a developer base consisting mostly of hobbyists and just a few organized development groups. There's a great deal of free online documentation available on XUL and extension development, but finding it and turning it into useful information can be a daunting task. Knowing where to look is critical and non trivial. This tutorial was aimed at compiling all the right resources for extension development and putting them in the right context, but there's much more to learn, and knowing how to find it is part of what we felt was necessary to teach. | ||
820 | Observer Notifications | |
Sometimes you need your code to send a message to other parts of your code. For example, you might want to notify that a task is completed, and then several different actions must be performed. You could do that by calling all those functions directly, but XPCOM offers you a better and cleaner way to achieve that using observers and the observer service. | ||
821 | Setting Up a Development Environment | |
There are 3 tools that we think are essential for effective add-on development (or any kind of development, really): a source code editor, a source control system, and a build system. | ||
822 | The Box Model | |
In order to master XUL, you'll need to have a fairly good understanding of its Box Model. This is the system that determines how all elements are laid out visually in a XUL document. It is important to know how it works in order to make interfaces that are easy to localize, skin and use in different types of operating systems, screen sizes and resolutions. | ||
823 | The Essentials of an Extension | |
In the last section we looked at the contents of the Hello World extension. Now we'll look into its files and code, starting with the install.rdf file. You can open it with any text editor. | ||
824 | Useful Mozilla Community Sites | |
The Mozilla Community is very rich and active. It's a very powerful tool you have when developing on top of the Mozilla platform, and you should take advantage of it in order to create a truly successful add-on . | ||
825 | User Notifications and Alerts | |
It is often the case that extensions need to notify users about important events, often requiring some response. Using modal dialogs and alerts is usually a bad idea. They interrupt the user's workflow, demanding immediate action before anything else can be done. Users will find them annoying and probably will learn to dismiss them as quickly as possible without even reading what they have to say. Or they will just get rid of your add-on. | ||
826 | XPCOM Objects | |
Taken from the XPCOM page. | ||
827 | Performance best practices in extensions | Add-ons, Best practices, Extensions, Guide, NeedsContent, NeedsExample, Performance |
One of Firefox's great advantages is its extreme extensibility. Extensions can do almost anything. There is a down side to this: poorly written extensions can have a severe impact on the browsing experience, including on the overall performance of Firefox itself. This article offers some best practices and suggestions that can not only improve the performance and speed of your extension, but also of Firefox itself. | ||
828 | Security best practices in extensions | Add-ons, Best practices, Extensions, Guide, Security |
This document is intended as a guide for developers to promote best practices in securing your extension. Your goal is to keep your users safe. Some items mentioned are strict guidelines, meaning that if you don't follow them then your add-on will not be approved on Mozilla add-ons. Other items are recommendations. The difference will be clearly flagged. | ||
829 | Setting up an extension development environment | Add-ons, Extensions, Guide |
This article provides suggestions for how to set up your Mozilla application for extension development. These details apply to Firefox, Thunderbird, and SeaMonkey (version 2.0 and above). | ||
830 | Signing and distributing your add-on | |
Once you have a first build of your add-on, you'll want to distribute it so others can give it a try. Whether you are distributing your add-on publicly or privately, through addons.mozilla.org (AMO) or elsewhere, you'll want to have your add-on package signed. | ||
831 | Submitting an add-on | Add-ons, Tutorial, WebExtensions |
This article walks you through the process of submitting an add-on. If you are just looking to submit your add-on, click here. | ||
832 | Source Code Submission | Add-ons, Review Policy, add-ons |
When uploading extensions to addons.mozilla.org (AMO), you are given the option to attach source code. There are certain cases where this is required, but others where it is not recommended. This page will explain when and where source code should be uploaded, and how to provide reviewers with instructions on reading your source code. Providing clear instructions to the reviewer will help you get a speedier review for your add-on. | ||
833 | Techniques | |
. | ||
834 | Promises | Add-ons, Examples, Snippets, async |
Due to the performance and stability costs of synchronous IO, many APIs which rely on it have been deprecated. The following page contains examples of many Promise -based replacement APIs for common operations. These APIs allow asynchronous operation to be achieved with a coding style similar to synchronous variants. |
||
835 | Themes | Add-ons, Look & Feel, Themes |
Themes allow you to change the look and feel of the user interface and personalize it to your tastes. Learn how to create and share themes! | ||
836 | Create Your Own Firefox Background Theme | |
No summary! | ||
837 | Lightweight themes | Add-ons, Lightweight themes, Personas, Themes |
No summary! | ||
838 | Frequently Asked Questions for Lightweight themes | |
Lightweight themes are easy-to-install, easy-to-use skins that change the look of your Firefox web browser. There are hundreds of thousands community-designed themes to choose from, with more added every day. Start looking here for designs that fit your style. | ||
839 | Obsolete | |
This page contains theme documents and resources that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs. | ||
840 | Theme concepts | Theme, add-on |
WebExtension based themes in Firefox enable you to change the look of the browser by adding images to the header area of the Firefox browser; this is the area behind the menu bar, toolbars, address bar, search bar, and tab strip. | ||
841 | Thunderbird extensions | Add-ons, Extensions, thunderbird |
Categories | ||
842 | Adding items to the Folder Pane | |
This tutorial examines how to add items to an existing Folder Pane view. The result is a javascript file that will add a "Numbers" container to the end of Thunderbird's "All Folders" mode. That container will have 3 child-items, the numbers 1, 2, and 3. Clicking on those items will display the number in the main viewing pane of Thunderbird. | ||
843 | Adding views to the Folder Pane | |
This is a stub page for a tutorial for Thunderbird 3. | ||
844 | An overview of Thunderbird components | thunderbird |
The Thunderbird mail application is a group of components built on a set of technologies that can seem daunting to new developers. However, in many cases you only need to learn a few concepts to write an extension. | ||
845 | Building a Thunderbird extension 1: introduction | Add-ons, Extensions, add-ons, thunderbird |
Thunderbird is Mozilla's open-source email application. It shares many of the technologies used by Firefox, including JavaScript, the Gecko layout engine, the XUL XML User Interface Language and the XPCOM Cross-Platform Component Object Model. Similar to Firefox, Thunderbird functionality can be enhanced and customized via extensions. | ||
846 | Building a Thunderbird extension 2: extension file layout | Extensions, thunderbird |
Extensions are packaged and distributed in archive files (also known as Bundles), with the XPI (pronounced “zippy”) file extension. At a minimum, they contain an install.rdf, the chrome.manifest and a chrome/ folder. The chrome/ folder contains a content/ folder that contains the actual content files. These files contain the code that makes your extension actually do something. When this tutorial is finished, our extension will look like this: |
||
847 | Building a Thunderbird extension 3: install manifest | Extensions, thunderbird |
The install.rdf file is an XML file that provides general information about the extension. |
||
848 | Building a Thunderbird extension 4: chrome manifest | Extensions, thunderbird |
The file called chrome.manifest tells Thunderbird what packages and overlays are provided by the extension. Open the file called chrome.manifest that you created and add this code: |
||
849 | Building a Thunderbird extension 5: XUL | Extensions, thunderbird |
Thunderbird's user interface is written in XUL and JavaScript. XUL is an XML grammar that provides user interface widgets like buttons, menus, toolbars, trees etc. We add widgets by inserting new XUL DOM elements into the application window and modify them using scripts and attaching event handlers. While XUL provides the elements of the user interface, actions are written in JavaScript. | ||
850 | Building a Thunderbird extension 6: Adding JavaScript | |
In this step we will create a small piece of JavaScript code that inserts the current date into our statusbar widget. Depending on the installed theme the result will look something like this: | ||
851 | Building a Thunderbird extension 7: Installation | Extensions, thunderbird |
While you are developing the extension, there are two ways you can make Thunderbird load it so you can test it as you go. You can either put the folder with the extension files directly into Thunderbird's extensions folder, or you can put a file there that tells Thunderbird where your extension is located. (In step 8 you will learn how to package an .xpi file for distribution and installation.) | ||
852 | Building a Thunderbird extension 8: packaging | Extensions, thunderbird |
When you are satisfied with how your extension works, package it for deployment and installation. | ||
853 | Building a Thunderbird extension 9: distributing | Extensions, thunderbird |
The addons.mozilla.org site is a distribution site where you can host your extension for free. Your extension will be hosted on Mozilla's mirror network. Mozilla's site also provides users with easier installation and will automatically make new versions available to users of your existing versions when you upload them. In addition Mozilla Update allows users to comment and provide feedback on your extension. It is highly recommended that you use AMO to distribute your extensions. | ||
854 | Creating a Custom Column | Add-ons, Extensions, add-ons, thunderbird |
In this example we will be developing a small extension that will be adding a column that will display the "Reply-To:" field of an email (if it exists, it if often not set). If you are unfamiliar with the setup and creation of an extension please read Building a Thunderbird Extension. | ||
855 | Demo Addon | |
This demo add-on has been created by Jonathan Protzenko for his presentation at MozCamp 2011. It shows how to achieve various goals in a working live example, such as working with Gloda. | ||
856 | Error reporting tools | thunderbird |
Currently, Thunderbird tends to eat a lot of exceptions. Some make it to the error console, most don't. There are deep fixes to the platform needed (e.g. bug 493414), but in the meantime, it would be helpful to be able to get useful output on stderr about exceptions, events and pretty-printed objects. |
||
857 | FAQ | Add-ons, Extensions, add-ons, thunderbird |
The old contents of this FAQ page were duplicated in the Setting up extension development environment article and the Building a Thunderbird extension article. (Duplicate content has been removed from this page.) | ||
858 | Finding the code for a feature | Add-ons, Extensions, add-ons, thunderbird |
Frequently you are trying to figure out the code that implements a specific feature of the user interface. How do you find that out? As an example, I received the following inquiry, and I decided to follow my usual path and document what I do: | ||
859 | Styling the Folder Pane | |
The folder pane in Thunderbird is predominantly controlled by code in folderPane.js. Since Thunderbird 3, the folder pane is designed in a more modular and extensible fashion. It is now possible to place non-mail entities in the folder pane. | ||
860 | Theme Packaging | Add-ons, Themes, Toolkit API |
This document describes how to package themes for Thunderbird. | ||
861 | Thunderbird HowTos | Add-ons, Extensions, add-ons, thunderbird |
Please add questions or answers to this page so that other people can benefit from your work. Also, you will see that there are many topics for which there is a question, but no answer. Please help by adding an answer! (Adding another question helps too!) | ||
862 | Activity Manager examples | |
The Activity Manager is a simple component that understands how to display a combination of user activity and history. See the Activity Manager page for a general description of the component. See the Activity Manager interfaces page for an overview of the related interfaces. | ||
863 | Common Thunderbird Extension Techniques | thunderbird |
No summary! | ||
864 | Access StringBundle from Overlay | thunderbird |
No summary! | ||
865 | Access Thunderbird Window Areas | thunderbird |
To access particular parts of the Thunderbird window you can use these helper methods. An alternative to these methods is to directly access the element by it's ID as in the Detect When a Folder Opens example. | ||
866 | Access Window | missing, thunderbird |
The window object represents the Window of the Thunderbird application as well as the currently opened tabs. You can do many things with the window object, such as accessing the height or width of the window/tab or setting its title, registering timer events and much more. The Window API will give you the complete details. Since window is a global variable you can use it directly from your JavaScript file. |
||
867 | Access Window Area | NeedsUpdate, missing, thunderbird |
This page has no content. Enrich MDC by contributing. | ||
868 | Add New Tab | missing, thunderbird |
No summary! | ||
869 | Add Option to Context Menu | incomplete, thunderbird |
Assuming this on chrome.manifest: | ||
870 | Add Tab | NeedsUpdate, missing, thunderbird |
This page has no content. Enrich MDC by contributing. | ||
871 | Add Toolbar Button | |
Example XUL overlay file: | ||
872 | Create Custom Column | thunderbird |
The article "Creating a Custom Column" will get you well on the road to creating your own columns and populating them with custom data. The customDBHeaders Preference article provides information on a preference setting that exposes custom header data for use in a custom column within Thunderbird's main view. | ||
873 | Detect Opening Folder | thunderbird |
Some actions require execution every time you open a folder (for example, registering a custom column handler. To do this you need to capture the select event of the folder [[XUL:tree|tree]] whose id is (conveniently) folderTree like so: | ||
874 | Filter Incoming Mail | filter, incoming, mails, thunderbird |
To filter incoming mail, the first step is to detect new messages inconming. The, you've got Components.interfaces.nsIMsgDBHdr from where you can modify the mail. By example, to modify the mail subject : |
||
875 | Get Thunderbird version | thunderbird |
On Thunderbird version 3.0b3pre and later, you can use the following snippet to get the Thunderbird version. (Version 3.0b3pre was the first build to include STEEL.) | ||
876 | Modify Folder Pane Display | missing, thunderbird |
See https://addons.mozilla.org/en-US/thu...er-categories/ for an example. | ||
877 | Modify Message List | NeedsContent, NeedsUpdate, missing, thunderbird |
This page has no content. Enrich MDC by contributing. | ||
878 | Use SQLite | thunderbird |
If you'd like to use an SQLite database in your extension you'll need to look over the Storage docs for an API reference, however this code should get you started. Be careful of multi-thread access to your database. | ||
879 | Folders and message lists | Guide, thunderbird |
The FolderDisplayWidget for the current folder can be accessed via the global variable gFolderDisplay . This object provides many of the functions required for working with folder views. We'll look at some of them below. |
||
880 | Thunderbird developer reference docs | |
No summary! | ||
881 | Tips and Tricks from the newsgroups | thunderbird |
The following discussions on mozilla.dev.apps.thunderbird and mozilla.dev.extensions include useful tips for Thunderbird add-on developers. Please feel free to add links to threads. We will add a categorization system as the link list grows. You can also help by creating how-tos from any of these topics. | ||
882 | Working with the Folder Pane | Add-ons, Extensions, add-ons, thunderbird |
The "Folder Pane" refers to the main navigation element that appears on the left side of the main Thunderbird window. Here, users traditionally find a hierarchical view of their accounts and folders. Beginning in Thunderbird 2, additional views on those folders ("Recent Folders", "Favorite Folders", and "Unread Folders") were added, accessible via the scroll-arrows at the top of the pane. | ||
883 | customDBHeaders Preference | |
developing a custom column to display a 'Superfluous' column within Thunderbird's main view. The data will come from a custom header labeled X-Superfluous | ||
884 | Updates | |
Firefox supports automated updates to add-ons using JSON update manifests. Add-ons hosted on AMO automatically receive updates to new versions posted there. Other add-ons must specify the location of their update manifests. | ||
885 | Working with multiprocess Firefox | |
In older versions of Firefox, chrome code (including code inserted by extensions) and content run in the same operating system process. So extensions can access content directly: | ||
886 | Using the message manager from Firefox extensions | |
This article explains how to refactor a Firefox extension to use the message manager. This enables the extension to work in multiprocess Firefox. | ||