Browser asks for restart to install addons on FF49 and above

Hello,

As FF49 is out, I found out that if there are no addons currently installed, Firefox always requires a restart to install an addon.

I found this link https://blog.mozilla.org/addons/2016/08/15/restart-required/ and the comments mention: < In Firefox 48, multiprocess capability was only enabled for people with no add-ons installed. If you are one of these people and you now install an add-on, you’ll be asked to restart Firefox even if the add-on is restartless. >

I believe this is what i am experiencing on FF49.
But in this case, when installing, the require(‘sdk/self’).loadReason value is always “startup” even upon install.
My current main.js code contains the following:
if (loadReason === “install”) {
// do something that only executes during install
}

Now this is broken with FF49 and I am not sure how to deal with the browser restart. I could detect the first addon execution by using local storage, but this is not as good as reading loadReason.

Any ideas? Thanks!

Sadly this is a know issue that will no longer be an issue with 50, since in 50 the browser will no longer have to restart if you have the multiprocess flag set (which you really should set).

I see, I was also trying on the Firefox Developer Edition which is FF51 and also experienced the restart, but I suppose this is because it is not the final FF 51.
I am a little confused by the multiprocess flag.
How can I be sure that my extension works well under the multiprocess mode?
From my testing on FF49, every API that I am using is performing well (there are Low-level APIs, High-level and also some XPCOM APIs). Does that mean the addon handles multiprocess mode? Or maybe I could possibly experience some APIs crashing later this year for example on FF 52?

Or should I add “permissions”: { “multiprocess”: true } no matter what?

If you don’t currently have the multiprocess flag set, then you need to set it and re-validate your extension (ensuring you do that with Firefox in multi-process mode), iirc developer edition is multiprocess by default now.

The multiprocess flag turns off various shims that may have been allowing your extension to work (they can also cause your extension to be slower). There’s a useful document on MDN of the details of the shims and what you might need to change once you’ve set the multiprocess flag.

1 Like