I am new to developing Firefox extensions. So I experimented a bit. I'm currently trying to create a boot extension with no more than minimal requirements: only install.rdf and bootstrap.js. At the moment, this extension should not actually do anything. I only want to install it without any problems. Functionality can be added later.
The install.rdf and bootstrap.js settings were packaged in a .zip file with 7zip, then the file extension was changed to .xpi. The installation was done through AddOn Manager and it seems to work fine in my Firefox 42.0 (Firefox gives me a success message).
But if I look at the error console after installation, it shows a few warnings / errors:
1447258032068 addons.xpi WARN Error loading bootstrap.js for Test-AddOn--53d9108a-541b-4209-a62e-3809504dfe6e@example.org : Error opening input stream (invalid file name?): Jar: file: /// C : /Users/Stefan/AppData/Roaming/Mozilla/Firefox/Profiles/dlgniy94.default/extensions/ Test-AddOn--53d9108a-541b-4209-a62e-3809504dfe6e@example.org.xpi /bootstrap.js
1447258032068 addons.xpi WARN Add-on Test-AddOn--53d9108a-541b-4209-a62e-3809504dfe6e@example.org there is no method to remove the boot
1447258032080 addons.xpi WARN Error loading bootstrap.js for Test-AddOn--53d9108a-541b-4209-a62e-3809504dfe6e@example.org : Error opening input stream (invalid file name?): Jar: file: /// C : /Users/Stefan/AppData/Roaming/Mozilla/Firefox/Profiles/dlgniy94.default/extensions/ Test-AddOn--53d9108a-541b-4209-a62e-3809504dfe6e@example.org.xpi /bootstrap.js
1447258032080 addons.xpi WARN Add-on Test-AddOn--53d9108a-541b-4209-a62e-3809504dfe6e@example.org missing boot method
Zeitstempel: 11.11.2015 17:07:12 Fehler: [... " : 0x80004005 (NS_ERROR_FAILURE) [nsIURI.hostPort]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame:: resource://gre/modules/PopupNotifications.jsm:: PopupNotifications_refreshPanel/<:: line 579" data: no] Quelldatei: resource://gre/modules/PopupNotifications.jsm : 583
1447258032112 addons.xpi WARN Add-on Test-AddOn--53d9108a-541b-4209-a62e-3809504dfe6e@example.org
, /. , , .
bootstrap.js:
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import('resource://gre/modules/Services.jsm');
function startup(aData, aReason) {}
function shutdown(aData, aReason) {}
function install(aData, aReason) {}
function uninstall(aData, aReason) {}
, , , ?
(startup(), shutdown(), install(), uninstall()) . ( , .)
, Firefox 42.0 , ? (shutdown())?
( ), ?
- ?
install.rdf:
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>Test-AddOn--53d9108a-541b-4209-a62e-3809504dfe6e@example.org</em:id>
<em:type>2</em:type>
<em:name>Test AddOn</em:name>
<em:version>1.0</em:version>
<em:bootstrap>true</em:bootstrap>
<em:description>This is a test.</em:description>
<em:creator>Anonymous</em:creator>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>40.0</em:minVersion>
<em:maxVersion>45.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
https://developer.mozilla.org/en-US/Add-ons/Bootstrapped_extensions#chrome.manifest_in_bootstrapped_add-ons
chrome.manifest "can" (, , , ).
.xpi-, :
http://www.filedropper.com/testaddon