WebExtensions: Difference between revisions
Wmccloskey (talk | contribs) m (Wmccloskey moved page Browser Extensions to WebExtensions: Change the name of the technology) |
Wmccloskey (talk | contribs) (packaging) |
||
Line 10: | Line 10: | ||
We hope to ship a preliminary version of this API in Firefox 42. | We hope to ship a preliminary version of this API in Firefox 42. | ||
== Packaging == | |||
We're planning to use the .zip file extension. All of the data currently in install.rdf will be moved to the manifest.json file. Will will not use install.rdf or bootstrap.js. Extensions will be signed using JAR signing (the same as we do for existing Firefox add-ons). | |||
See https://developer.chrome.com/extensions/manifest for a complete list. | See https://developer.chrome.com/extensions/manifest for a complete list of manifest directives. The ones we currently support are below. | ||
* name | * name | ||
Line 25: | Line 25: | ||
* browser_action | * browser_action | ||
* default_locale | * default_locale | ||
In addition, we plan to add the following section: | |||
<blockquote><pre> | |||
"applications": { | |||
"gecko": { | |||
"id": "{the-addon-id}", | |||
"strict_min_version": "40.0.0", | |||
"strict_max_version": "50.*" | |||
"update_url": "https://foo/bar" | |||
} | |||
} | |||
</pre></blockquote> | |||
Both versions will be Gecko rapid release versions. The update URL points to an [https://developer.mozilla.org/en-US/docs/Extension_Versioning,_Update_and_Compatibility#Update_RDF_Format update manifest]. We hope to make all of these properties optional. The id would have to be generated fresh either upon local installation or when uploaded to addons.mozilla.org or Marketplace. | |||
== List of supported APIs == | == List of supported APIs == |
Revision as of 23:31, 6 August 2015
This page is an introduction to Mozilla's implementation of a new browser extension API. The goals of this API are:
- It should be easier to use.
- It must be compatible with multiprocess Firefox (Electrolysis).
- Porting add-ons to and from other browsers should be easier.
- Changes to Firefox's internal code should be less likely to break add-ons.
- It should be easier to review add-ons to reduce the backlog on addons.mozilla.org.
Much of the specifics of the new API are similar to the Blink extension API. Google has extensive documentation on the API. So does Opera.
We hope to ship a preliminary version of this API in Firefox 42.
Packaging
We're planning to use the .zip file extension. All of the data currently in install.rdf will be moved to the manifest.json file. Will will not use install.rdf or bootstrap.js. Extensions will be signed using JAR signing (the same as we do for existing Firefox add-ons).
See https://developer.chrome.com/extensions/manifest for a complete list of manifest directives. The ones we currently support are below.
- name
- version
- description
- content_scripts
- permissions
- web_accessible_resources
- background
- browser_action
- default_locale
In addition, we plan to add the following section:
"applications": { "gecko": { "id": "{the-addon-id}", "strict_min_version": "40.0.0", "strict_max_version": "50.*" "update_url": "https://foo/bar" } }
Both versions will be Gecko rapid release versions. The update URL points to an update manifest. We hope to make all of these properties optional. The id would have to be generated fresh either upon local installation or when uploaded to addons.mozilla.org or Marketplace.
List of supported APIs
Note that we expect to fix virtually all of the exceptions printed below.
- alarms
- This API is entirely supported.
- browserAction
- We don't support the imageData attribute on setIcon.
- We don't support enable or disable.
- extension
- We support only getBackgroundPage and getURL.
- i18n
- We support only getMessage in the JavaScript API.
- We only support @@extension_id and @@ui_locale predefined messages.
- We don't localize CSS files.
- Strings to be localized must consist entirely of __MSG_foo__ in order for a substitution to be made.
- notifications
- The only supported notification options are iconUrl, title, and message.
- The only methods we support are create, clear, and getAll.
- The only event we support is onClosed. We don't provide byUser data.
- runtime
- We support onStartup, getManifest, id, and the message passing interfaces (sendMessage, onMessage, onConnect).
- storage
- The only storage area we support is local.
- We don't support getBytesInUse or clear.
- tabs
- Unsupported functions: getCurrent, sendRequest, getSelected, duplicate, highlight, move, detectLanguage, captureVisibleTab, get/setZoom, get/setZoomSettings. We probably will never support detectLanguage or captureVisibleTab.
- We treat highlighted and active as effectively the same since Firefox cannot select multiple tabs.
- webNavigation
- We don't support getFrame or getAllFrames.
- We don't support onCreatedNavigationTarget or onHistoryStateUpdated.
- We don't support transition types and qualifiers.
- onReferenceFragmentUpdated also triggers for pushState.
- Filtering is unsupported.
- webRequest
- We don't support handlerBehaviorChanged.
- We don't support onAuthRequired, onBeforeRedirect, or onErrorOccurred.
- Requests can be canceled only in onBeforeRequest.
- Requests can be modified/redirected only in onBeforeSendHeaders.
- Responses can be modified only in onHeadersReceived.
- windows
- onFocusChanged will trigger multiple times for a given focus change.
- create does not support the focused, type, or state options.
- update only supports the focused option.
List of APIs we will likely support in the future
Additional APIs
We plan to add our own APIs based on the needs of existing Firefox add-ons.
- NoScript-type functionality. This would come in the form of extensions to webRequest and possibly contentSettings.
- Sidebars. Opera already supports sidebar functionality; Chrome may soon. We would like to be able to implement Tree Style Tabs or Vertical Tabs by hiding the tab strip and showing a tab sidebar.
- Toolbars. Firefox has a lot of existing toolbar add-ons.
- Better keyboard shortcut support. We'd like to support Vimperator-type functionality.
- Ability to add tabs to about:addons.
- Ability to modify the tab strip (Tab Mix Plus).