Вопрос

I have created an extension for mozilla firefox. Now, I'm trying to distribute the extension on an simple web site. I generate a sha1 hash code from an online generator. This is the code I have in my web site:

<script type="application/javascript"> function install (aEvent) { for (var a = aEvent.target; a.href === undefined;) a = a.parentNode; var params = { "Foo": { URL: aEvent.target.href, Hash: aEvent.target.getAttribute("hash"), toString: function () { return this.URL; } } }; InstallTrigger.install(params); return false; } </script> <a href="c:/grouAndUsersWorkSpace/MozillaAddon/createtab.xpi" hash="sha1:a7093a2afe1a53fde114a4a7dcb3e15e57862642" onclick="return install(event);">Install Extension!</a>

the path of the url is local. And as a result when I start the application I got "The add-on could not be downloaded because of a connection failure on localhost".

I changed the path of the url to be: file://c:/grouAndUsersWorkSpace/MozillaAddon/createtab.xpi and with this nothing happens.

I have two questions: 1. Is that a good way to generate a hash code? 2. What should cause that connection failure?

Это было полезно?

Решение

1) I prefer to use the CHK Checksum Utility to generate checksums.

2) I don't have access at the moment to verify it, but have you tried serving the extension with Apache or similar?

Edit

Since you used a local file, you'll need a 3 slashes instead of 2 : file URI scheme .

Tested it both ways, they both work.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top