Closed Bug 890085 Opened 11 years ago Closed 11 years ago

Malformed browser.search.defaultenginename string can lock user's searchbox selection

Categories

(Firefox :: Search, defect)

23 Branch
All
Other
defect
Not set
major

Tracking

()

RESOLVED FIXED
Firefox 25
Tracking Status
firefox23 + verified
firefox24 + verified
firefox25 --- verified

People

(Reporter: WeirdAl, Assigned: Gavin)

References

()

Details

Attachments

(1 file)

In testing FF23 beta against Ask toolbars (our company's product), our QA team discovered the searchbox would not allow the user to switch away from Ask to another search engine. Our product was setting the browser.search.defaultenginename preference to the string "Ask Search". We are fixing this bad preference usage on our side, per instructions from https://developer.mozilla.org/en-US/docs/draft_Search_Extension_Tutorial . We should have the fix out well before FF 23 goes to the release channel. However, there may be other products from companies who also have an invalid value for this preference. The error from nsPrefBranch.cpp was: "NS_ERROR_MALFORMED_URI: Component returned failure code: 0x804b000a (NS_ERROR_MALFORMED_URI) [nsIPrefBranch.getComplexValue]" The offending JavaScript line was this, from nsSearchService.js: let defaultEngine = defaultPrefB.getComplexValue("defaultenginename", nsIPLS).data; This happens when trying to set the default engine to another selection in the searchbox. A fix for this may be as simple as a try/catch block in the setter for default engine.
OS: Windows 7 → All
Hardware: x86_64 → All
(In reply to Alex Vincent [:WeirdAl] from comment #0) > In testing FF23 beta against Ask toolbars (our company's product), our QA > team discovered the searchbox would not allow the user to switch away from > Ask to another search engine. Our product was setting the > browser.search.defaultenginename preference to the string "Ask Search". > We are fixing this bad preference usage on our side, per instructions from > https://developer.mozilla.org/en-US/docs/draft_Search_Extension_Tutorial . > We should have the fix out well before FF 23 goes to the release channel. Thanks for the report. Can you elaborate on how you were setting it, and how you fixed it?
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #1) > Thanks for the report. Can you elaborate on how you were setting it, and how > you fixed it? I've e-mailed the details privately to Gavin.
Attached patch patch (deleted) — Splinter Review
Essentially, the add-on was giving the pref an invalid default value (it's a localized pref, so its default value must be a URI to a properties file). This caused the _originalDefaultEngine getter to throw, which broke switching engines.
Attachment #772332 - Flags: review?(mdeboer)
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Target Milestone: Firefox 23 → ---
Comment on attachment 772332 [details] [diff] [review] patch Review of attachment 772332 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me!
Attachment #772332 - Flags: review?(mdeboer) → review+
Comment on attachment 772332 [details] [diff] [review] patch [Approval Request Comment] Bug caused by (feature/regressing bug #): bug 738818 User impact if declined: search selection broken if a broken add-on is installed Testing completed (on m-c, etc.): manual Risk to taking this patch (and alternatives if risky): no risk, dead-simple protection against bogus pref values String or IDL/UUID changes made by this patch: none
Attachment #772332 - Flags: approval-mozilla-beta?
Attachment #772332 - Flags: approval-mozilla-aurora?
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment on attachment 772332 [details] [diff] [review] patch Very low risk, acts as a safety net if a broken add-on is installed for a new Fx23 feature. Gavin please add qawanted if you think we need any additional testing wrt this new feature+toolbars
Attachment #772332 - Flags: approval-mozilla-beta?
Attachment #772332 - Flags: approval-mozilla-beta+
Attachment #772332 - Flags: approval-mozilla-aurora?
Attachment #772332 - Flags: approval-mozilla-aurora+
Keywords: verifyme
I didn't find any installers for the Ask.com toolbar for Ubuntu or Mac. Could anyone please provide a link for download (if there is) ? For Windows 7 64bit, I got the next results: 1) with Firefox 23 beta 3, I wasn't able to install the toolbar from http://apnstatic.ask.com/static/toolbar/everest/download/index.html?source=sp 2) with Firefox 23 beta 7 (build ID: 20130718163513), after installing the toolbar, the "browser.search.defaultenginename" preference stays the same (I tried to install Ask.com both when I didn't change the search engine from its default value (Google) and afterwards I changed it to Bing) and all 4 searches (URL bar, search bar, about:home page and contextual menu option) are performed as expected
Flags: needinfo?
(In reply to Manuela Muntean [:Manuela] [QA] from comment #10) > I didn't find any installers for the Ask.com toolbar for Ubuntu or Mac. > Could anyone please provide a link for download (if there is) ? There are none. We're Windows-only at this time.
Flags: needinfo?
Thanks Alex! :) Then I think I can mark this verified for Firefox 23, based on comment 10 (part 2))
OS: All → Other
QA Contact: manuela.muntean
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 20130812173056 Tested as verified on 24 beta 2, Win 7 64bit.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 Tested as verified on latest Aurora (20130908004001).
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: