Spark Add-on on b2g
Bugs
Bug 1162200 - (spark-addons) [Meta] Spark Add-ons Support
– Bug 923897 - Extensibility support for b2g
Reuse mozApps
and manifest.webapp
:
navigator.mozApps .installPackage (AddonManifestURL)
navigator.mozApps .mgmt .uninstall (DOMApplication)
{
"customizations" : [
{
"filter" : "http://youtube.com" ,
"css" : ["file1.css" , "file2.css" ],
"scripts" : ["script1.js" , "script2.js" ]
}
],
"role" : "addon"
}
Only allow customizations to apply to apps with an equal or lower privilege level.
Installation
Created with Raphaël 2.1.2 App App Webapps.js Webapps.js Webapps.jsm Webapps.jsm UserCustomizations.jsm UserCustomizations.jsm navigator.mozApps.installPackage(manifestURL, ...) return DOMRequest Webapps:InstallPackage Check ... Download ... Install ... Webapps:Install:Return:OK fire success Webapps:Install:Return:Ack updateAppHandlers(null, newManifest) register() _updateAllWindows()
Uninstall
Created with Raphaël 2.1.2 App App Webapps.js Webapps.js Webapps.jsm Webapps.jsm UserCustomizations.jsm UserCustomizations.jsm navigator.mozApps.mgmt.uninstall(DOMApplication) Webapps:Uninstall Check ... Clear ... unregister() _unloadForManifestURL() Webapps:Uninstall:Return:OK
Update
Version control?
Other
Hackerplace
https://github.com/fxos/directory
http://directory.fxosapps.org/apps.json
Add-on sdk on Firefox Desktop
TDB
Note
Addon manifest: install.rdf ?
installRequiresRestart(this.addon) –> addon provides bootstrap or not ?
Chrome Extension API on Firefox Desktop
Introduce Chrome Extension API
https://docs.google.com/a/mozilla.com/presentation/d/1LscJGUTO74hP_6tEf6I6_nsAR24xSu9WhHUKk182eaE/edit?usp=sharing
Bugs
Bug 1161828 - [meta] Parity with Chrome extension API
– Bug 1175770 - Experiment with new extension API
– Bug 1190692 - Support Web Extensions in the add-on manager
Manifest
https://developer.chrome.com/extensions/manifest
"applications" : {
"gecko" : {
"id" : "{the-addon-id}" ,
"strict_min_version" : "40.0.0" ,
"strict_max_version" : "50.*"
"update_url" : "https://foo/bar"
}
}
Installation
Created with Raphaël 2.1.2 AddonManager AddonManager XPIProvider.jsm XPIProvider.jsm WebExtensionBootstrap.js WebExtensionBootstrap.js Extension.jsm Extension.jsm ExtensionManagement.jsm ExtensionManagement.jsm ext_*.js ext_*.js AddonInstall.initLocalInstall() loadManifestFromWebManifest() addon.type = "webextension" startInstall() ?? load bootstrap (sandbox?) install() do nothing startup() new Extension() startupExtension() startup() emit("startup")
Load
Created with Raphaël 2.1.2 Extension.jsm Extension.jsm ext_backgroundPage.js ext_backgroundPage.js ext_browserAction.js ext_browserAction.js ExtensionContent.jsm ExtensionContent.jsm load manifest .... emit("manifest_background", ...) GlobalManager.injectInDocShell() ?? emit("manifest_browser_action", ...) CustomizableUI.createWidget() Extension:Startup (with content_scripts)
Other
Extension.jsm is the main entry point for extensions. When an extension loads, its bootstrap.js file creates a Extension instance and calls .startup()
on it. It calls .shutdown()
when the extension unloads. Extension manages any extension-specific state in the chrome process.
Addon manifest: install.rdf and manifest.json
addon._sourceBundle
WebExtensionBootstrap.js
Access moz-extension: moz-extension:// + uuid
?
Communication between background page and contect script ?
New extension model in b2g
Bugs
Bug 1192026 - [meta] Add-on support for 2.5
– Bug 1190995 - Support the new extension model in b2g
– Bug 1191619 - Support extensions with no packaged manifest.webapp
Manifest
Load
Created with Raphaël 2.1.2 Webapps.jsm Webapps.jsm UserCustomizations.jsm UserCustomizations.jsm Extension.jsm Extension.jsm register() startup()
Other
Security