Closed Bug 783275 Opened 12 years ago Closed 9 years ago

browser.search.selectedEngine value does not change if user just deletes the current Search Engine

Categories

(Firefox :: Search, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: nikolas.markantonis, Unassigned)

Details

Attachments

(2 files, 1 obsolete file)

Attached image ffx.jpg
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1
Build ID: 20120713134347

Steps to reproduce:

- Navigate to about:config - Accept to be careful
- On the search field type browser.search.selectedEngine
- A. Change search engine from the tool on the top right
- B. Click on manage Search Engines, select the current one and delete. Click ok


Actual results:

A. Property value changes correctly.
B. Search engine is changed, however browser.search.selectedEngine value remains the same.


Expected results:

Both Search engine and property´s value should change.
Component: Untriaged → Search
Confirmed
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17 Firefox/17.0a1 ID:20120816030539
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 7 → All
Hardware: x86_64 → All
Version: 14 Branch → Trunk
Since the default search engine would be displayed in the search box and everything works fine after deleting the selected engine, I don't actually see an issue.  If user changes the engine again, the preference would be set correctly again.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
The issue might not affect directly ffx users, but it affects programs that "detect" ffx default search engine by reading that value..
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
For add-ons to detect the currently selected search engine, I think they should use nsIBrowserSearchService (https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService) instead of depending on the preferences.
I generally agree with Raymond, but it's also not very hard to change the selectedEngine setter's behavior to always set the pref, so it might not hurt to change it to do that (that's assuming that most uses of the pref from third-party code isn't malicious, which may be an incorrect assumption :().
Attached patch v1 (obsolete) — Splinter Review
Attachment #668554 - Flags: review?(ttaubert)
Comment on attachment 668554 [details] [diff] [review]
v1

Shouldn't you compare engineToRemove with this._currentEngine before removing it, and clear the pref if they're the same?
Attachment #668554 - Flags: review?(ttaubert) → review-
Attached patch v2Splinter Review
Yes, whenever setting this._currentEngine = null, it would use the default engine and the selectedEngine pref should be clear.
Attachment #668554 - Attachment is obsolete: true
Attachment #669043 - Flags: review?(gavin.sharp)
Comment on attachment 669043 [details] [diff] [review]
v2

Thanks! It would be really nice to have a test for this behavior, I think it should be relatively easy to add an xpcshell test next to the existing ones.
Attachment #669043 - Flags: review?(gavin.sharp) → review+
Given this as received no activity in almost 3 years, I suspect the use case here isn't really important. There have also been several changes to the way default engine selection is saved in the meantime.
Status: REOPENED → RESOLVED
Closed: 12 years ago9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: