Closed Bug 1849129 Opened 9 months ago Closed 8 months ago

An extension adding a duplicate search engine will prevent the SearchService from initializing

Categories

(Firefox :: Search, defect, P3)

defect

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: pierov, Assigned: pierov)

Details

Attachments

(1 file)

We noticed that SearchService will fail to initialize when an extension tries to install a search engine with the same name as a built-in search engine.

#installExtensionEngine tries to install the engine, but it fails and throws an exception.
This function is also called in the for (let extension of this.#startupExtensions) in #loadEngines, but it does not contain a try-catch.
So, any exception caused by extensions will affect the initialization of the whole SearchService, and no search engine will be available, not even the built-in ones.

I tried this not in Firefox, but in a fork, but I think the same should happen upstream.

Moreover, I think that if #installExtensionEngine is called later and it fails in only one of the locales, it leaves the extension in a half-installed state: some locales will be installed, others will not.

The severity field is not set for this bug.
:standard8, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(standard8)
Severity: -- → S2
Flags: needinfo?(standard8)
Priority: -- → P3

I've updated the patch to address your comments, but I think I'd need some help with the test.
Thank you in advance!

Flags: needinfo?(standard8)

Yes, sorry, I've just been on PTO for a week, but should get to it in a little bit.

Flags: needinfo?(standard8)
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/39bd64035bbc
Prevent exceptions caused by extensions from interrupting the SearchService initialization. r=search-reviewers,Standard8
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch

I tried to reproduce this issue with no success.
Could you please provide reproduction steps in order to properly verify this issue?
Thank you.

Flags: needinfo?(pierov)

Hi, I encountered this when developing a fork, but the problem applied to Firefox as well.
In our case, we added Mullvad Leta to the bundled search engines and the Mullvad extension was trying to install it as well.
For testing with Firefox, you would need an addon that for example tries to re-implement Google or another built-in engine (just for testing purposes, but I don't have an easy str).

Flags: needinfo?(pierov)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: