Closed Bug 1569256 Opened 7 years ago Closed 6 years ago

isBuiltIn is undefined for search extensions

Categories

(Toolkit :: Add-ons Manager, enhancement, P3)

enhancement

Tracking

()

RESOLVED WONTFIX

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.

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

Flags: needinfo?(mozilla)

add-on isBuiltIn.

addon.isBuiltIn should be true.

Flags: needinfo?(mozilla)

Moving across to add-on manager as search doesn't have control of that flag.

Component: Search → Add-ons Manager
Product: Firefox → Toolkit
Blocks: 1564100

Running this in the browser console displays "true" for me:
(await AddonManager.getAddonByID("wikipedia@search.mozilla.org")).isBuiltin

More detailed STR please?

Flags: needinfo?(mozilla)

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.

Flags: needinfo?(mozilla)

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: nobody → mozilla
Status: NEW → ASSIGNED
Type: defect → enhancement
Priority: P1 → P3

We're not using getActiveAddons anymore, and I don't really think this fix is necessary.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.