Over the past 1.5 weeks, I spent a lot of outdated documentation to try to figure out the “right way” to install a self-updating update for Firefox. I used https://developer.mozilla.org/en-US/docs/Installing_Extensions_and_Themes_From_Web_Pages and a method InstallTrigger.install(...)to specify the URL. I got it to work a little, but it seems so fragile that there should be a better way.
Is there a new way in jpmfor this? Is there any sample code that I can see for this to really work?
Now I am facing a problem where "The add-on being downloaded is not the one Mozilla expects", which I'm sure means that the hashes are incompatible. However, I triple checked the hash of the .xpi (SHA1) file, and it worked previously, and it just refuses to stay in place. Here is my code in TypeScript.
element.click((event: JQueryEventObject) =>
{
var params = {
"My Extension": {
URL: "https://(redacted for privacy)/addon.xpi",
Hash: "sha1:ef5662925bbf6d32ff5554bb4edb34b44045ada6"
}
};
InstallTrigger.install(params);
});
What is it. When they click on the link, it must be installed.
Any help here is appreciated. Is InstallTrigger the only way to install an extension?
source
share