Closed
Bug 1313695
Opened 10 years ago
Closed 8 years ago
Provide a way to do a restartless upgrade of a registry-installed extension
Categories
(Toolkit :: Add-ons Manager, defect, P5)
Tracking
()
RESOLVED
INACTIVE
People
(Reporter: sixtyten, Unassigned)
Details
(Whiteboard: triaged)
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
Build ID: 20161019084923
Steps to reproduce:
Motivation: Because we install a native binary along with the extension that we talk to via runtime.connectNative(), we prefer to have control over the XPI so as to be able to update extension and binary in lockstep. Using a store-provided version is possible (we do it for Chrome as there's no alternative here), but requires an ugly workaround and wastes everybody's bandwidth through unneeded downloads and update requests.
1. Install a WebExtension XPI through a registry key as documented in [1]. (In my testing, both the XPIs I used were signed by Mozilla)
2. Start Firefox 51+ (any version that supports chrome.runtime.reload), observe that version 1.0.0 is loaded.
3. Start a cmd in the folder that contains the XPI, delete it with `del`. (Deleting it through explorer won't work because it's opened in Firefox)
4. For good measure, run chrome.runtime.reload() in the debugger.
5. Place an XPI with a higher version in the manifest (in my case, 1.0.1) in the XPI's original location.
6. again, run chrome.runtime.reload() in the debugger. Observe which version of the extension is loaded.
7. Restart Firefox. Observe the extension version.
[1] https://developer.mozilla.org/en-US/docs/Archive/Mozilla/Adding_extensions_using_the_Windows_registry - marked as obsolete but works just fine.
Actual results:
4: With the file deleted and not replaced yet, chrome.runtime.reload() returns undefined and the extension keeps running.
6: With the file replaced by an updated version, the extension reloaded successfully, but kept using the old version (1.0.0).
7. After the restart, Firefox used 1.0.1.
Expected results:
4: This behavior looks reasonable to me.
6: The version should've been that of the updated XPI's (1.0.1, not 1.0.0).
7: Expected.
Component: Untriaged → WebExtensions: Untriaged
OS: Unspecified → Windows
Product: Firefox → Toolkit
Updated•10 years ago
|
Component: WebExtensions: Untriaged → Add-ons Manager
Comment 1•10 years ago
|
||
I don't agree with the expected results from the original report -- reload() is not intended to apply upgrades unless the onUpdateAvailable event was previously triggered. It sounds like what you're really after here is a way to do a restartless upgrade of an extension that is installed via the Window registry, which is not currently supported.
The registry location is sort of a mess since any extension installed that way is potentially shared by multiple profiles or even multiple users so a single browser session can't assume it "owns" the extension. The current solution is that we just check for upgrades on browser restarts (with details explained in the MDN page linked from the original description). I think it would be feasible to implement the webextensions requestUpdateCheck() api for registry-installed extensions and have it apply that logic that is currently applied at startup and then have the extension go through the regular update flow. I'd strongly prefer doing that to having reload() apply updates.
That said, I don't have the cycles to work on this right now. I'd be happy to help out and review patches if somebody else wants to work on it though.
Priority: -- → P5
Summary: chrome.runtime.reload should check whether the xpi on disk changed and reload it if it did → Provide a way to do a restartless upgrade of a registry-installed extension
> a way to do a restartless upgrade of an extension that is installed via the Window registry
Yes, that is exactly what I'm after. I'm fine with using requestUpdateCheck, however there's no implementation or even a bug for it, so I figured that using the already implemented chrome.runtime.reload was simpler.
I've created bug 1314922 for the general implementation of requestUpdateCheck.
Updated•10 years ago
|
Whiteboard: triaged
Comment 3•8 years ago
|
||
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INACTIVE
You need to log in
before you can comment on or make changes to this bug.
Description
•