Closed Bug 1973315 Opened 6 months ago Closed 5 months ago

Refactor AppProvided Engine vs UserInstalledAppEngine

Categories

(Firefox :: Search, task, P3)

task

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: mcheang, Assigned: mbeier)

References

Details

(Whiteboard: [sng])

Attachments

(1 file)

Context

In AppProvidedSearchEngine.sys.mjs, we currently have both AppProvidedSearchEngine and UserInstalledAppEngine defined in the same file. This is pretty confusing because "app-provided" should mean the engine is bundled with Firefox. Users shouldn't be able to install something that’s considered "app-provided." However, we now have a feature where users can install "app-provided" engines through contextual search.

Problem

The terminology has started to blur. Right now, AppProvidedSearchEngine and UserInstalledAppEngine are lumped together even though they represent different concepts. We need a clearer separation between engines that are pre-bundled with Firefox and those installed by users.

Solution

AppProvidedSearchEngine and UserInstalledAppEngine are engines from search-config-v2. That's the common theme.
We can introduce a ConfigEngine base class that both app-provided and user-installed config-based engines can extend. Something like:

                  SearchEngine
                       |
                  ConfigEngine
                   /       \
AppProvidedConfigEngine   UserInstalledConfigEngine

Follow-ups / Cleanup

  • All instances of UserInstalledAppEngine should be renamed to something more accurate, such as UserInstalledConfigEngine
    UserInstalledAppEngine references
  • We could also consider removing nsISearchEngine. The use of engine.wrappedJSObject feels unnecessary and kind of a nuisance at this point
    nsISearchEngine
QA Whiteboard: [sng]
Whiteboard: [sng]
Severity: -- → N/A
Priority: -- → P3
Attachment #9498944 - Attachment description: Bug 1973315 - Refactor AppProvided Engine vs UserInstalledAppEngine. r?standard8 → Bug 1973315 - Refactor AppProvided Engine vs UserInstalledAppEngine.
Attachment #9498944 - Attachment description: Bug 1973315 - Refactor AppProvided Engine vs UserInstalledAppEngine. → Bug 1973315 - Refactor AppProvided Engine vs UserInstalledAppEngine. r?standard8
Pushed by mbeier@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/20c99a090617 https://hg.mozilla.org/integration/autoland/rev/4a797b6be43b Refactor AppProvided Engine vs UserInstalledAppEngine. r=Standard8,urlbar-reviewers,mcheang
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
QA Whiteboard: [search] [qa-triage-done-c143/b142]
See Also: → 1980871
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: