I try to follow the instruction at
https://developer.mozilla.org/en/docs/Building_an_Extension
to build a firefox add-on.
I changed install.rdf to
<?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>helloworld#mozilla.doslash.org</em:id>
<em:name>Hello World extension for Firefox</em:name>
<em:version>1.0</em:version>
<em:description>Demo extension.</em:description>
<em:creator>Nickolay Ponomarev</em:creator>
<!-- optional items -->
<em:contributor>A person who helped you</em:contributor>
<em:contributor>Another one</em:contributor>
<em:homepageURL>http://kb.mozillazine.org/Getting_started_with_extension_development</em:homepageURL>
<!--em:optionsURL>chrome://sampleext/content/settings.xul</em:optionsURL>
<em:aboutURL>chrome://sampleext/content/about.xul</em:aboutURL>
<em:iconURL>chrome://sampleext/skin/mainicon.png</em:iconURL>
<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>12.0</em:minVersion>
<em:maxVersion>32.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
when install it reports
your comment welcome
The core files of an extension (install.rdf, chrome.manifest and bootstrap.js where applicable) must be saved with ANSI encoding. Check if your editor defaults to some unicode flavor.
Related
I am trying to test the newer Geolocation API (in place of the older ILocation COM API), which is a WinRT API.
I 've followed instructions from here to allow a normal C++ desktop Win32 app to call Windows 10 RT functions. It works normally in my tests.
However, for location, I must include a capability in a XML file as discussed here.
How am I supposed to create this XML file? I tried creating a file like this:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Capabilities>
<!-- DeviceCapability elements must follow Capability elements (if present) -->
<DeviceCapability Name="location"/>
</Capabilities>
<Identity Name=""
Version=""
Publisher="" />
<Properties>
<DisplayName></DisplayName>
<PublisherDisplayName></PublisherDisplayName>
<Logo></Logo>
</Properties>
<Prerequisites>
<OSMinVersion></OSMinVersion>
<OSMaxVersionTested></OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="" />
</Resources>
<Applications>
<Application Id="" StartPage="">
<VisualElements DisplayName="" Description=""
Logo="" SmallLogo=""
ForegroundText="" BackgroundColor="">
<SplashScreen Image="" />
</VisualElements>
</Application>
</Applications>
</Package>
I am not sure what to do from now on. Is there a compiler setting that would tell the compiler/linker to include this appxmanifest file?
Thanks
I'm new here. I attempted to follow the basic guide to setting up my plugin to autoupdate, but no matter what I tried, the Addons Manager simply returns "No updates found" to me.
This is my first version, with the McCoy updateKey and the updateURL.
<?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>rikaicake#kirei.cake</em:id>
<em:name>RikaiCake Custom JP-EN Dictionary</em:name>
<em:version>1.0.20141010</em:version>
<em:description>The next generation Rikaichan dictionary, catered for translators and dedicated Japanese enthusiasts alike, by one single wholehearted translator. (Disclaimer: No credit is claimed for the creation of the original dictionary by James Breen or any others involved. This is solely a fan contribution.)</em:description>
<em:creator>Nitori</em:creator>
<em:homepageURL>http://kireicake.com/rikaicakehome/</em:homepageURL>
<em:iconURL>chrome://rikaicake/content/icon.png</em:iconURL>
<em:icon64URL>chrome://rikaicake/content/icon64.png</em:icon64URL>
<em:unpack>true</em:unpack>
<em:type>2</em:type>
<!-- Update variables -->
<em:updateURL>http://kireicake.com/rikaicake/update.rdf</em:updateURL>
<em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLELaF2leBsPJJXGwEW8Eju5crK/vXDHmNFbNb7I/na64jX00tNud8sjjRQiXmkm7rRqdmIkwqsvCJAeF92HmLRAN9DxxLHUcNO5TJ9MpsjgnJnS9Cpwp+9iQHzG5JE8IhyeuqL9UH1l8840q+o1F5+aU0gQfCXVq7ml35Cp5AcwIDAQAB</em:updateKey>
<!-- Firefox -->
<em:targetApplication>
...
</em:targetApplication>
</Description>
</RDF>
Next is the update.rdf, which contains both the McCoy signature as well as the correct sha1 hash of the new version's XPI file.
<?xml version="1.0"?>
<RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Seq RDF:about="rdf:#$juwpx">
<RDF:li RDF:resource="rdf:#$kuwpx"/>
</RDF:Seq>
<RDF:Description RDF:about="rdf:#$nuwpx"
em:id="rikaicake#kirei.cake"
em:minVersion="2.0"
em:maxVersion="99.*"
em:updateLink="http://kireicake.com/rikaicake/rikaicake-1.1.20141011.xpi"
em:updateHash="sha1:a88f474ce465ec8b027bf9d59f26aa4d758c1b0d" />
<RDF:Description RDF:about="urn:mozilla:extension:rikaicake#kirei.cake"
em:signature="MIGTMA0GCSqGSIb3DQEBDQUAA4GBAICj86yogJPhb4PKRfcXnqd2rGRVoo89TULFi6urSODlVW97RjwVkUt9t4cgvGvk8g5Ix8xVNKlybBLkXOfzMIIbWWMrK9MUHHly1Pi2BdW2ecOoUOEPpB73hVLwJggrVLCFogFoATtVLBMHC6wjxvRGfLt2M5alUu1jpm3RxOCF">
<em:updates RDF:resource="rdf:#$juwpx"/>
</RDF:Description>
<RDF:Description RDF:about="rdf:#$kuwpx"
em:version="1.1.20141011">
<em:targetApplication RDF:resource="rdf:#$nuwpx"/>
</RDF:Description>
</RDF:RDF>
And, just for reference, the updated install.rdf in the new version is basically the exact same albeit with a different em:version number (newer one).
<?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>rikaicake#kirei.cake</em:id>
<em:name>RikaiCake Custom JP-EN Dictionary</em:name>
<em:version>1.1.20141011</em:version>
<em:description>The next generation Rikaichan dictionary, catered for translators and dedicated Japanese enthusiasts alike, by one single wholehearted translator. (Disclaimer: No credit is claimed for the creation of the original dictionary by James Breen or any others involved. This is solely a fan contribution.)</em:description>
<em:creator>Nitori</em:creator>
<em:homepageURL>http://kireicake.com/rikaicakehome/</em:homepageURL>
<em:iconURL>chrome://rikaicake/content/icon.png</em:iconURL>
<em:icon64URL>chrome://rikaicake/content/icon64.png</em:icon64URL>
<em:unpack>true</em:unpack>
<em:type>2</em:type>
<!-- Update variables -->
<em:updateURL>http://kireicake.com/rikaicake/update.rdf</em:updateURL>
<em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLELaF2leBsPJJXGwEW8Eju5crK/vXDHmNFbNb7I/na64jX00tNud8sjjRQiXmkm7rRqdmIkwqsvCJAeF92HmLRAN9DxxLHUcNO5TJ9MpsjgnJnS9Cpwp+9iQHzG5JE8IhyeuqL9UH1l8840q+o1F5+aU0gQfCXVq7ml35Cp5AcwIDAQAB</em:updateKey>
<!-- Firefox -->
<em:targetApplication>
...
</em:targetApplication>
</Description>
</RDF>
I've also set up my .htaccess so that it would properly handle the files.
AddType text/rdf .rdf
AddType text/xml .rdf
AddType application/rdf+xml .rdf
AddType application/x-xpinstall .xpi
Does anybody have any idea what I could be doing wrong? I don't own my server, so I cannot set it to do HTTPS, so that is not an option. I tried several Firefox browsers, and they all do the same. The files can be accessed on the website, no problem at all.
For one thing, is my code wrong by any chance? If not, then I might just need to tell people to manually update. Thanks a bunch!
Oh, I found out the issue. It's working now. The issue was in my update.rdf:
<?xml version="1.0"?>
<RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Description RDF:about="rdf:#$nuwpx"
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
em:minVersion="2.0"
em:maxVersion="99.*"
em:updateLink="http://kireicake.com/rikaicake/rikaicake-1.1.20141011.xpi"
em:updateHash="sha1:a88f474ce465ec8b027bf9d59f26aa4d758c1b0d" />
<RDF:Seq RDF:about="rdf:#$juwpx">
<RDF:li RDF:resource="rdf:#$kuwpx"/>
</RDF:Seq>
<RDF:Description RDF:about="urn:mozilla:extension:rikaicake#kirei.cake"
em:signature="MIGTMA0GCSqGSIb3DQEBDQUAA4GBABuMUOfHzXvWVu2LlIxZalk94+HFLShDfugBBH7uUEU1knq7imKBIQ8Ilw38lJ/hfxVpXQx8jxywGBx6QPeqFMmBhu9ocKTiWIUQ+52O2i2p1pCw0VrcEd90KP1Tj0IXXthIpILp/VQMif4cloOaI//4ql27xHe0+L/NXkB/JZbN">
<em:updates RDF:resource="rdf:#$juwpx"/>
</RDF:Description>
<RDF:Description RDF:about="rdf:#$kuwpx"
em:version="1.1.20141011">
<em:targetApplication RDF:resource="rdf:#$nuwpx"/>
</RDF:Description>
</RDF:RDF>
em:id should be {Firefox GUID}, NOT the addon's ID. I went through a ton of trouble just to realize that I misinterpreted a field.
I followed instructions here and after installed I opened the console mode to debug but the log stuck there without any response:
The console just shows something like following and nothing more output:
*** LOG addons.updates: Requesting https://www.extension.host.com/update.rdf
My install.rdf is:
<?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>webmailchecker#mozilla.doslash.org</em:id>
<em:name>WebMail Checker for Firefox</em:name>
<em:version>1.0</em:version>
<em:description>WebMail Checker</em:description>
<em:updateURL>https://www.extension.host.com/update.rdf</em:updateURL>
<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.6</em:minVersion>
<em:maxVersion>23.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
And update.rdf is:
<?xml version="1.0" encoding="UTF-8"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<RDF:Description about="urn:mozilla:extension:webmailchecker#mozilla.doslash.org">
<em:updates>
<RDF:Seq>
<!-- Each li is a different version of the same add-on -->
<RDF:li>
<RDF:Description>
<em:version>1.0</em:version>
<em:targetApplication>
<RDF:Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>23.*</em:maxVersion>
<em:updateLink>https://www.extension.host.com/firefox.xpi</em:updateLink>
</RDF:Description>
</em:targetApplication>
</RDF:Description>
</RDF:li>
<RDF:li>
<RDF:Description>
<em:version>2.0</em:version>
<em:targetApplication>
<RDF:Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>23.*</em:maxVersion>
<em:updateLink>https://www.extension.host.com/firefox_2.0.xpi</em:updateLink>
</RDF:Description>
</em:targetApplication>
</RDF:Description>
</RDF:li>
</RDF:Seq>
</em:updates>
</RDF:Description>
</RDF:RDF>
In the server side, both of the update.rdf and the xpi file are returned as javax.ws.rs.core.Response and I have configured the mimemapping in the web.xml as the following:
<mime-mapping>
<extension>xpi</extension>
<mime-type>application/x-xpinstall</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rdf</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
Anything I missed? The automatic update is just not working.
Today I look back to this issue again and finally solved this. And I update the answer in case anyone else need this.
I looked into the source code AddonUpdateChecker.jsm which I should do this earlier.
I used javascript debugger to debug the update. Before this, I really didn't see any logs indicating that the I should have builtInCertificate.
And found that it's looking into the pref values about certificates.
Which are extensions.install.requireBuiltInCerts and extensions.update.requireBuiltInCerts.
Set these two prefs values to false and the udpate works.
Others with different ssl certificate may not meet this problem maybe.
I wrote an update.rdf for an automatic update service.
In the add on overview an can do a right click "search for new update" and firefox finds the new version on my test webspace, download it and "install" it. But after the restart I have the same version like before, it didn't changed the xpi files. Here are some pictures and the code snippets. Mabye you have an idea.
http://s12.postimage.org/f68kptdy3/script_error1.png
http://s12.postimage.org/57nm3c4ij/script_error2.png
After the restart I have version 0.2.3 again with no changes.
install.rdf of version 0.2.3
Code: Select all
<Description about="urn:mozilla:install-manifest">
<em:id>megxbar#megx.net</em:id>
<em:type>2</em:type>
<em:name>MegxBar</em:name>
<em:version>0.2.3</em:version>
.
.
.
<em:updateURL>http://home.arcor.de/eniac2000/update.rdf</em:updateURL> <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDO65zOLKafZWtmX/cvs9ELMT1VkCQ8GlZNbRMku0su8VxDr+k4eGFYUupHWy2Ll+rfXJ43k+nYQvYHZRoU94DtiCCk4GEpfGytQPCCHOl30aV9elJH+cmeSKZiejPvMptZfp9GXTcLWgVycPVwS59J/LFJ2St2QQSv2hgWV1dKlwIDAQAB</em:updateKey>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>15.0</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
update.rdf with signature (on the server)
<?xml version="1.0"?>
<RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Description RDF:about="rdf:#$ZpuSg3"
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
em:minVersion="1.5"
em:maxVersion="15.0"
em:updateLink="http://home.arcor.de/eniac2000/MegxBar_0.3.3.xpi"
em:updateHash="sha1:02226eedd92e895379881ec919ce07c7f73ff9a9" />
<RDF:Seq RDF:about="rdf:#$VpuSg3">
<RDF:li RDF:resource="rdf:#$WpuSg3"/>
</RDF:Seq>
<RDF:Description RDF:about="rdf:#$WpuSg3"
em:version="0.3.3">
<em:targetApplication RDF:resource="rdf:#$ZpuSg3"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mozilla:extension:megxbar#megx.net"
em:signature="MIGTMA0GCSqGSIb3DQEBDQUAA4GBAFOK3mZUdai/KCVRtHNvTYPV7Hu3+3b9ymfkGM3u08m0O7Ltl1tc0guYtZ74i+qUYC8T+66pgK/LeXnwzAHFUBcEfXFZGfwH8ZG8SR/lyZaUzSsAM9CPoYv1YIM/PjLfHtIEJdzROW1HG31YlsP3nouT5wSyEhvJiNQvAUwP37Aj">
<em:updates RDF:resource="rdf:#$VpuSg3"/>
</RDF:Description>
</RDF:RDF>
install.rdf in the xpi of version 0.3.3 on the server
<?xml version="1.0" encoding="UTF-8"?>
<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>megxbar#megx.net</em:id>
<em:type>2</em:type>
<em:name>MegxBar</em:name>
<em:version>0.3.3</em:version>
.
.
.
<em:updateURL>http://home.arcor.de/eniac2000/update.rdf</em:updateURL>
<em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDO65zOLKafZWtmX/cvs9ELMT1VkCQ8GlZNbRMku0su8VxDr+k4eGFYUupHWy2Ll+rfXJ43k+nYQvYHZRoU94DtiCCk4GEpfGytQPCCHOl30aV9elJH+cmeSKZiejPvMptZfp9GXTcLWgVycPVwS59J/LFJ2St2QQSv2hgWV1dKlwIDAQAB</em:updateKey>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>15.0</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
I created the signature with MCCOY and the hash value with the alternate hash generator for windows
If I download the MegxBar_0.3.3.xpi from your server and look at the install.rdf file inside I see:
<em:version>0.2.3</em:version>
So Firefox correctly updates your extension and installs the new version. Only problem is that the "new" version on your server is the old version, despite the file name.
I'm writing an add-on for Firefox 11, but when I load it I get the message that the add-on isn't compatible with Firefox 11.
Here is my 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>gnup#gear-network.com</em:id>
<em:unpack>true</em:unpack>
<em:name>GNUp</em:name>
<em:version>1.0</em:version>
<em:description>bleh bleh bleh</em:description>
<em:creator>Gear Network</em:creator>
<em:homepageURL>http://gear-network.com/</em:homepageURL>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.0</em:minVersion>
<em:maxVersion>11.0</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
Did anyone already have this problem before?
Here is a list of all versions usable as minVersion or maxVersion:
https://addons.mozilla.org/en-US/firefox/pages/appversions/
The value you provided (11.0) is probably too specific. Try using broader version identifier, e.g. 11.*. This will also include all minor updates in the future.