Open Bug 1673115 Opened 4 years ago Updated 3 years ago

Search shortcuts allows you to delete an engine when there is only one remaining

Categories

(Firefox :: Search, defect, P5)

Firefox 82
defect

Tracking

()

People

(Reporter: u659263, Unassigned)

References

(Depends on 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0

Steps to reproduce:

  1. Go to about:preferences#search
  2. Scroll to "Search Shortcuts"/"One-Click Search Engines"
  3. Delete all but one engine (make sure to delete Google). The Remove button will be greyed out when there is only one left.
    -- At this point, the remaining engine will be selected by default. If you open a new tab or window you will be able to search with it. --
  4. Select the remaining engine and press the delete key.

Actual results:

If you open a new tab or window Google will be your default search engine. If you refresh your preferences tab you'll see that the only search engine you have is Google.

Expected results:

Nothing should have happened, I shouldn't have to be able to delete the last engine and Google should not be made my only (and thus default) search engine.

Component: Untriaged → Search

Error message on the browser console:

01:52:30.903 Uncaught Error: Cannot remove last engine!
    removeEngine chrome://browser/content/preferences/search.js:719
    remove chrome://browser/content/preferences/search.js:538
    observe chrome://browser/content/preferences/search.js:442
    notifyAction resource://gre/modules/SearchUtils.jsm:189
    removeEngine resource://gre/modules/SearchService.jsm:1869
    onTreeKeyPress chrome://browser/content/preferences/search.js:514
    handleEvent chrome://browser/content/preferences/search.js:411
search.js:719:13

Thank you for the report.

The broken piece of code is here: https://searchfox.org/mozilla-central/rev/c409dd9235c133ab41eba635f906aa16e050c197/browser/components/preferences/search.js#506-515

Though we are currently working towards redoing that UI, so adding a dependency on that bug to remind us to check this afterwards.

Severity: -- → S4
Status: UNCONFIRMED → NEW
Depends on: search-alias
Ever confirmed: true
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.