isBuiltIn is undefined for search extensions
Categories
(Toolkit :: Add-ons Manager, enhancement, P3)
Tracking
()
People
(Reporter: mkaply, Assigned: mkaply)
References
Details
isBuiltIn is undefined for search extensions.
This means that things that check to make sure not to do anything with built in stuff don't work properly.
For my purposes, it means policy is accidentally uninstalling them.
Comment 1•7 years ago
|
||
Do you mean nsISearchEngine.isBuiltIn or a property on the add-on itself? nsISearchEngine doesn't currently have the isBuiltIn property so we'd have to expose that.
An the addon front, we seem to be checking extension.addonData.builtIn
| Assignee | ||
Comment 2•7 years ago
|
||
add-on isBuiltIn.
addon.isBuiltIn should be true.
Comment 3•7 years ago
|
||
Moving across to add-on manager as search doesn't have control of that flag.
Comment 4•7 years ago
|
||
Running this in the browser console displays "true" for me:
(await AddonManager.getAddonByID("wikipedia@search.mozilla.org")).isBuiltin
More detailed STR please?
| Assignee | ||
Comment 5•7 years ago
|
||
Now I'm completely confused. The issue was this code:
https://searchfox.org/mozilla-release/source/browser/components/enterprisepolicies/Policies.jsm#646
which gets its list of addons from getActiveAddons:
https://searchfox.org/mozilla-release/source/browser/components/enterprisepolicies/Policies.jsm#607
isBuiltIn was not set for the search addons which caused bug 1569244 - "Blocking all addons via policy uninstalls search, themes and all plugins"
But I just tried this in the scratchpad shows isBuiltin is set for the appropriate addons.
Maybe if you query getActiveAddons too early isBuiltin isn't set?
I'm not sure what's going on now.
Comment 6•7 years ago
|
||
Yeah, this is (sort of) documented here:
https://searchfox.org/mozilla-central/rev/1eb05019f47069172ba81a6c108a584a409a24ea/toolkit/mozapps/extensions/AddonManager.jsm#2848-2862
However, I suspect we could probably add isBuiltin to the stub objects returned when getActiveAddons() is called early here:
https://searchfox.org/mozilla-central/rev/1eb05019f47069172ba81a6c108a584a409a24ea/toolkit/mozapps/extensions/internal/XPIProvider.jsm#3054-3069
| Assignee | ||
Comment 7•7 years ago
|
||
What's odd is that I saw isBuiltIn set for some addons. I have no idea why since that code clearly wouldn't be setting it?
But yeah, I think that would be a useful parameter to have that early. I'll take.
| Assignee | ||
Comment 8•6 years ago
|
||
We're not using getActiveAddons anymore, and I don't really think this fix is necessary.
Description
•