Closed
Bug 1195353
Opened 9 years ago
Closed 9 years ago
Firefox should not delete extension proxy files when the add-on is found to be broken
Categories
(Toolkit :: Add-ons Manager, defect)
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: 4mr.minj, Assigned: rhelmer)
Details
Attachments
(1 file)
Steps: 1) Use extension proxy file[1] for add-on development in aurora channel 2) Set xpinstall.signatures.required to false 3) Upgrade from FF41 to FF42 Result: The proxy file was deleted on Firefox launch after upgrade Expected: The proxy file should have not been deleted. Add-on development should continue without a hitch. [1] https://developer.mozilla.org/en-US/Add-ons/Setting_up_extension_development_environment#Firefox_extension_proxy_file
Reporter | ||
Comment 1•9 years ago
|
||
The original description applies to a profile that was previously used for Firefox beta. Additionally UNIX symlinks are removed as well. The 'dev-edition-default' one must have some prefs set or something and has a different behavior. Namely, the file is not removed but the extension is not in the list anyway.
Comment 2•9 years ago
|
||
(In reply to 4mr.minj from comment #1) > The original description applies to a profile that was previously used for > Firefox beta. > Additionally UNIX symlinks are removed as well. FWIW symlinks have never been a supported way to add extensions into Firefox, still we shouldn't be deleting their contents.
Product: Firefox → Toolkit
Assignee | ||
Comment 3•9 years ago
|
||
On Firefox release (40.0) and Nightly (43.0a1) on Mac OS X with xpinstall.signatures.required=false, I see this in the console for a proxy add-on: 1439921975864 addons.xpi WARN Disabling foreign installed add-on @fox-candy in app-profile In both cases I get the about:newaddon?id=@fox-candy dialog on startup, and the proxy add-on works fine if I allow the installation. The only way I've been able to repro so far is if there is something wrong with the proxy file (e.g. ends in .xpi and the zip reader fails, path in proxy file does not contain manifest, etc.) If you start Firefox from a terminal, do you see a message about why this add-on has been disabled?
Flags: needinfo?(4mr.minj)
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Comment 4•9 years ago
|
||
Note that if you enable extensions.logging.enabled you'll see a bunch of messages from the add-ons manager which might reveal what is going on.
Reporter | ||
Comment 5•9 years ago
|
||
This issue is too unpredictable. Proxy files are deleted only sometimes. However the addon is never listed among installed
Here's the output when proxy file is removed:
> addons.xpi WARN addMetadata: Add-on {myAddonID} is invalid: SyntaxError: JSON.parse: unexpected character at line 22 column 4 of the JSON data (resource://gre/modules/addons/XPIProvider.jsm:755:18) JS Stack trace: loadManifestFromWebManifest@XPIProvider.jsm:755:18 < loadManifestFromDir@XPIProvider.jsm:1181:17 < TaskImpl_run@Task.jsm:314:40 < TaskImpl@Task.jsm:275:3 < createAsyncFunction/asyncFunction@Task.jsm:249:14 < loadManifestFromFile@XPIProvider.jsm:1290:12 < syncLoadManifestFromFile@XPIProvider.jsm:1301:3 < addMetadata@XPIProvider.jsm:3477:22 < XPI_processFileChanges@XPIProvider.jsm:3758:23 < XPI_checkForChanges@XPIProvider.jsm:3919:34 < XPI_startup@XPIProvider.jsm:2413:25 < callProvider@AddonManager.jsm:221:12 < _startProvider@AddonManager.jsm:703:5 < AMI_startup@AddonManager.jsm:874:9 < AMP_startup@AddonManager.jsm:2514:5 < AMC_observe@addonManager.js:55:7
I get nothing in cases when it is not removed.
FYI there is nothing wrong with that proxy file: old nightly (42.0a1) accepts it but aurora 42.0a2 does not.
Flags: needinfo?(4mr.minj)
Comment 6•9 years ago
|
||
Ah interesting. We're finding a bad install manifest for the extension and so removing because of that (https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIProvider.jsm#3488). What has changed in 42 is our new support for Web Extensions. Is your extension a Web Extension or is it just a standard extension with an install.rdf file? Firefox is finding a manifest.json file in your extension, treating it as a Web Extension but seeing an error in the manifest and so rejecting the extension because of that. It would make sense to not remove pointer files in that case, we should expect that extensions under development occasionally go invalid.
Reporter | ||
Comment 7•9 years ago
|
||
No, it's not a web extension.
> <em:unpack>true</em:unpack>
> <em:type>2</em:type>
> <em:bootstrap>true</em:bootstrap>
Comment 8•9 years ago
|
||
Is there a manifest.json file in the extension's directory? If not that suggests something is broken with how we're detecting these
Reporter | ||
Comment 9•9 years ago
|
||
BINGO. The same directory is used for chrome. You should test for install.rdf before that ;)
Reporter | ||
Comment 10•9 years ago
|
||
By chrome I mean google chrome, of course. Google chrome extensions use manifest.json since forever. Forcing to use different checkouts between browsers would be very inconvenient.
Comment 11•9 years ago
|
||
So we're starting to support chrome-like extensions. The reason we're checking for manifest.json first right now is that it allows you to write an add-on that uses the chrome extension support in Firefox when available but still supports older Firefox that only support install.rdf. Maybe that's a mistake though, it seems likely that there will be many people in the same situation as you. What are your thoughts Bill?
Flags: needinfo?(wmccloskey)
Reporter | ||
Comment 12•9 years ago
|
||
I have an idea why manifest.json parsing fails then. Google chrome allows to use comments in that file even though they are not allowed in the JSON spec.
Comment 13•9 years ago
|
||
(In reply to 4mr.minj from comment #12) > I have an idea why manifest.json parsing fails then. > > Google chrome allows to use comments in that file even though they are not > allowed in the JSON spec. That's going to be fun for us to support, filed bug 1196283 for that.
Let's check for install.rdf first. If people want to support old versions of Firefox, they'll have to use the maxVersion stuff and ship separate add-ons. I'm worried that lots of Firefox add-ons also happen to include manifest.json files. We don't want to start breaking them if our WebExtension support isn't up to par yet. However, I think we should WONTFIX the comment issue. It doesn't make sense for us to try to be bug-compatible with Chrome.
Flags: needinfo?(wmccloskey)
Comment 15•9 years ago
|
||
Ok, I've spun off checking for install.rdf first into bug 1196301, that should be a straightforward fix we can uplift to 41. I'd like to keep this bug open for not deleting pointer files when the add-on is broken, that's still something we should fix, though it has been like it for a while so I don't think it is as important. You can figure out the comments for manifest.json in bug 1196283
Component: Security → Add-ons Manager
Summary: Firefox should not delete extension proxy files with add-on signatures disabled → Firefox should not delete extension proxy files when the add-on is found to be broken
Comment 16•9 years ago
|
||
(In reply to Dave Townsend [:mossop] from comment #15) > Ok, I've spun off checking for install.rdf first into bug 1196301, that > should be a straightforward fix we can uplift to 41. That should be 42, not 41
Comment 17•9 years ago
|
||
Feel like taking this Rob? It should just be a case of checking installLocation.isLinkedAddon before removing the add-on and writing tests. Might need to check the updateMetadata case too though.
Flags: needinfo?(rhelmer)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → rhelmer
Flags: needinfo?(rhelmer)
Assignee | ||
Updated•9 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee | ||
Comment 18•9 years ago
|
||
bug 1195353 - leave extension proxy files that point to invalid manifests r?mossop
Attachment #8692391 -
Flags: review?(dtownsend)
Assignee | ||
Comment 19•9 years ago
|
||
I did not modify the updateMetadata function, because I cannot figure out any way to get an update check to run against an unpacked add-on (proxy files only work for unpacked add-ons, right?)
Updated•9 years ago
|
Attachment #8692391 -
Flags: review?(dtownsend)
Comment 20•9 years ago
|
||
Comment on attachment 8692391 [details] MozReview Request: bug 1195353 - leave extension proxy files that point to invalid manifests r?mossop https://reviewboard.mozilla.org/r/26255/#review23979 ::: toolkit/mozapps/extensions/internal/XPIProviderUtils.js:1635 (Diff revision 1) > - if (!aInstallLocation.locked) > + if (aInstallLocation.isLinkedAddon) isLinkedAddon is a function ::: toolkit/mozapps/extensions/internal/XPIProviderUtils.js:1636 (Diff revision 1) > - aInstallLocation.uninstallAddon(aId); > + logger.warn("Could not uninstall invalid item because it is a proxy file"); I think a better warning is: "Not uninstalling invalid item because it is a proxy file"
Assignee | ||
Updated•9 years ago
|
Attachment #8692391 -
Flags: review?(dtownsend)
Assignee | ||
Comment 21•9 years ago
|
||
Comment on attachment 8692391 [details] MozReview Request: bug 1195353 - leave extension proxy files that point to invalid manifests r?mossop Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26255/diff/1-2/
Comment 22•9 years ago
|
||
Comment on attachment 8692391 [details] MozReview Request: bug 1195353 - leave extension proxy files that point to invalid manifests r?mossop https://reviewboard.mozilla.org/r/26255/#review24095
Attachment #8692391 -
Flags: review?(dtownsend) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 23•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/8b459a753480
Keywords: checkin-needed
Comment 24•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8b459a753480
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Updated•8 years ago
|
Severity: blocker → normal
Comment 25•8 years ago
|
||
For what it's worth, the latest Developer Edition 51.0a2 (20161016004034) is still affected while Nightly 52.0a1 (20161016030205) is not. For example, if `matches` entry inside `content_scripts` entry in addon's manifest contains `*.` instead of `*` as host (e.g. as a result of misreading documentation), the proxy file is deleted when starting Firefox Developer Edition. Entire relevant part of manifest: "content_scripts": [ { "matches": ["https://*./*"], "js": ["example.js"], "run_at": "document_end" } ],
You need to log in
before you can comment on or make changes to this bug.
Description
•