Closed Bug 730445 Opened 12 years ago Closed 11 years ago

Add UI to specify a default search engine

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(relnote-firefox 23+)

RESOLVED FIXED
Firefox 23
Tracking Status
relnote-firefox --- 23+

People

(Reporter: bug.zilla, Assigned: Margaret)

References

Details

Attachments

(2 files, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build ID: 20120215223356

Steps to reproduce:

Pressed "Go" after entering a search term


Actual results:

Google results page appears for the search term


Expected results:

I have added additional search engines from http://mycroft.mozdev.org, but I cannot select which one of those I want to use as the default one, i.e. like the desktop version.
This issue doesn't occur on

Nightly:Fennec/13.0a1
Devices: HTC Desire Z
OS: Android 2.3.3 

NOTE: To make a specific search engine the default search engine you have to modify the keyword.URL field in about:config whit the search engine URL.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
There is currently no visible UI to alter the default search engine regardless of third party installs; so to reiterate what Paul mentioned, one must change the default by tweaking a preference value under about:config
I was not able to set duckduckgo as the default search engine. I have it installed and working, tried modifying keyworkd.URL with duckduckgo.com and after that failing browser.search.defaultenginename with DuckDuckGo, what's wrong?
(In reply to Aaron Train [:aaronmt] from comment #2)
> There is currently no visible UI to alter the default search engine
> regardless of third party installs; so to reiterate what Paul mentioned, one
> must change the default by tweaking a preference value under about:config

Why is that an acceptable "worksforme" option? The default search engine is a very important setting in a browser. Searching is probably 70% of how most people navigate the web.
(In reply to Alexandre Provencio from comment #4)
> I was not able to set duckduckgo as the default search engine. I have it
> installed and working, tried modifying keyworkd.URL with duckduckgo.com and
> after that failing browser.search.defaultenginename with DuckDuckGo, what's
> wrong?

You have to set keyword.URL to "https://duckduckgo.com/?q=" and it should work with that.
Just to be clear, that's a workaround. We have an "options" page for search addons. We just need to add a "Set as default" option there.
(In reply to donrhummy from comment #5)
> (In reply to Aaron Train [:aaronmt] from comment #2)
> > There is currently no visible UI to alter the default search engine
> > regardless of third party installs; so to reiterate what Paul mentioned, one
> > must change the default by tweaking a preference value under about:config
> 
> Why is that an acceptable "worksforme" option? The default search engine is
> a very important setting in a browser. Searching is probably 70% of how most
> people navigate the web.

Quoted the wrong comment; re-opening to see if we want to add a 'set as default' for installed engines.
Status: RESOLVED → REOPENED
Ever confirmed: true
OS: Windows 7 → Android
Hardware: x86_64 → ARM
Resolution: WORKSFORME → ---
Summary: Default search engine → Request: Allow one to specify a default search engine
Version: Firefox 13 → Trunk
Flags: needinfo?(ibarlow)
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #6)
> (In reply to Alexandre Provencio from comment #4)
> > I was not able to set duckduckgo as the default search engine. I have it
> > installed and working, tried modifying keyworkd.URL with duckduckgo.com and
> > after that failing browser.search.defaultenginename with DuckDuckGo, what's
> > wrong?
> 
> You have to set keyword.URL to "https://duckduckgo.com/?q=" and it should
> work with that.

Worked, thanks
(In reply to Aaron Train [:aaronmt] from comment #8)
> (In reply to donrhummy from comment #5)
> > (In reply to Aaron Train [:aaronmt] from comment #2)
> > > There is currently no visible UI to alter the default search engine
> > > regardless of third party installs; so to reiterate what Paul mentioned, one
> > > must change the default by tweaking a preference value under about:config
> > 
> > Why is that an acceptable "worksforme" option? The default search engine is
> > a very important setting in a browser. Searching is probably 70% of how most
> > people navigate the web.
> 
> Quoted the wrong comment; re-opening to see if we want to add a 'set as
> default' for installed engines.

That will be very useful. In addiction the devs should considering changing the default search engine order for suggestions to appear on top, for when suggestion aware search engines starts to appear to follow Google's.
QA Contact: pcheng
If we implement this feature, we could let distributions modify the default search engine, but then this would give users the power to change it if they're not happy with it.

I'll take this bug, and I can take responsibility for asking ibarlow nicely about what the UX for this should look like.
Assignee: nobody → margaret.leibovic
Summary: Request: Allow one to specify a default search engine → Add UI to specify a default search engine
I started playing around with doing this in the add-on manager, and the UX feels kinda awkward because there can only be one default search engine, so toggling on an individual level feels odd (so far I just implemented a button to make a specific search engine into the default, since I didn't even know what to label an un-default button).

I also don't think users will go looking in the add-on manager to change their search settings (desktop doesn't even show search plugins in about:addons). I think it would make sense to make this into a radio-choice item in Settings (the search service would include any custom search engines that are installed in this list). However, I also know we've been trying to organize/streamline our Settings UI, so I want to hear some UX feedback about where this should go.

For reference, in bug 738818 there's talk of adding UI for changing the default search engine to the desktop preferences window. 

Also, for reference, keyword.URL is probably going to die (we don't actually use it in Fennec anyway). To change your default search engine The Right Way, you should change "browser.search.defaultenginename" to the name of the search engine.
I know it's not the "desktop way", but as long as we have Search Engines in the Add-on Manager I think we should use it as the way to manage search engines. We already support enable/disable there.

Also, we support the same "set the one default item" for Themes in the Add-on Manager too. Id' be happy renaming the Add-on Manager to something else too.

I just don't want to scatter UI for a "thing" into too many different places.
(In reply to :Margaret Leibovic from comment #12)
> (desktop doesn't even show search plugins in about:addons)

There are plans to change that in bug 755126, FWIW.
(In reply to Mark Finkle (:mfinkle) from comment #13)
> I know it's not the "desktop way", but as long as we have Search Engines in
> the Add-on Manager I think we should use it as the way to manage search
> engines. We already support enable/disable there.

Fair enough.

> Also, we support the same "set the one default item" for Themes in the
> Add-on Manager too.

Well, right now we do that with the Enable/Disable button, since you can only have one enabled at a time. So we'll need to add some other button ("Make Default"?) for search engines.

> Id' be happy renaming the Add-on Manager to something
> else too.

That sounds like an interesting idea. We can explore that as a follow-up. "Add-on" does feel like the wrong word for the search engines we ship.

> I just don't want to scatter UI for a "thing" into too many different places.

Okay, you've convinced me.
Attached patch WIP (obsolete) — Splinter Review
This just adds a "Make Default" button on the add-ons details page.

Issues:
* The awesomescreen doesn't listen for changes to default search engine, so the order of the search engines (and the "do you wanna turn on search suggestions?" message don't get updated). So you need to restart for this to get updated (but the new default search does work immediately).
* We could also add a context menu item in the main list (but this could be done in a follow-up).
* The UI for this can probably be nicer, but I'm bad at coming up with how to make things look intuitive :)
Attachment #726424 - Flags: feedback?(mark.finkle)
Attached image screenshot
I'm open to putting the button somewhere else. This was just easy.
I was thibking wed treat this as an optiin. Like addon options.
(In reply to Wesley Johnston (:wesj) from comment #18)
> I was thibking wed treat this as an optiin. Like addon options.

Assuming I read this correctly....

I don't think this could be an "option", but it should be on the "detail" page for a search engine, which is how Margaret has it.

Someday, we should completely re-work the add-on and download managers. They look kinda crappy in general. I think a context menu would work too, when in the "list" page.
Comment on attachment 726424 [details] [diff] [review]
WIP

>diff --git a/mobile/android/chrome/content/aboutAddons.xhtml b/mobile/android/chrome/content/aboutAddons.xhtml

>       <div class="buttons">
>         <button id="enable-btn" class="show-on-disable hide-on-enable hide-on-uninstall" onclick="Addons.enable();">&addonAction.enable;</button>
>         <button id="disable-btn" class="show-on-enable hide-on-disable hide-on-uninstall" onclick="Addons.disable();">&addonAction.disable;</button>
>         <button id="uninstall-btn" class="hide-on-uninstall" onclick="Addons.uninstall();">&addonAction.uninstall;</button>
>         <button id="cancel-btn" class="show-on-uninstall" onclick="Addons.cancelUninstall();">&addonAction.undo;</button>
>+        <button id="default-btn" onclick="Addons.makeDefault();">&addonAction.makeDefault;</button>

Should we use | class="show-on-enable hide-on-disable" | or something so the default button is not shown (or maybe disabled) if the search engine is disabled? Not shown is probably best.

>diff --git a/mobile/android/locales/en-US/chrome/aboutAddons.dtd b/mobile/android/locales/en-US/chrome/aboutAddons.dtd

>+<!ENTITY addonAction.makeDefault                "Make Default">

"Set as Default" ?
Attachment #726424 - Flags: feedback?(mark.finkle) → feedback+
Comment on attachment 726424 [details] [diff] [review]
WIP

Review of attachment 726424 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/chrome/content/aboutAddons.js
@@ +491,5 @@
> +    let addon = detailItem.addon;
> +    if (addon.type != "search")
> +      return;
> +
> +    Services.prefs.setCharPref("browser.search.defaultenginename", addon.id);

So, doing this is bad because the search service doesn't expect this pref to be modified at runtime (that's why the search engine order is wrong in the awesomescreen after modifying this pref). I think we may need to wait for the patch in bug 738818. The scope of that bug is pretty large, so maybe they can split off the toolkit parts we'll want into a separate patch.
Attached patch WIP v2 (obsolete) — Splinter Review
This adds support for the context menu item.
Attachment #726424 - Attachment is obsolete: true
Depends on: 738818
Depends on: 858809
Attached patch patchSplinter Review
I developed this on top of the defaultSearch patch from bug 738818, which is almost ready to land.

I included a line to reorder the search engines when one becomes the default, but we'll probably want to get rid of that if this is ready to land before we have a solution for bug 858809.

We only show search suggestions UI (including the prompt to enable them) if Google is the default search engine, so this patch doesn't cause any problems, but it would be good to make sure this works if we enable search suggestions for multiple providers. Also, if the user enabled Google search suggestions before changing the default search engine, should we still be showing them in the list? This can be done in a follow-up, but it's something to consider.
Attachment #726754 - Attachment is obsolete: true
Attachment #734133 - Flags: review?(mark.finkle)
Attachment #734133 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/9a84b4562333
Status: REOPENED → RESOLVED
Closed: 12 years ago11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
Flags: in-moztrap?(fennec)
I've created test cases, you can find them here:
https://moztrap.mozilla.org/manage/cases/?filter-suite=281.
Please let me know if it's ok. Thanks.
Flags: in-moztrap?(fennec) → in-moztrap+
(In reply to Pop Mihai from comment #28)
> I've created test cases, you can find them here:
> https://moztrap.mozilla.org/manage/cases/?filter-suite=281.
> Please let me know if it's ok. Thanks.

These look great, thanks! You thought of some cases that I didn't even test out myself when writing this patch :)
Blocks: 867071
Blocks: 867059
Blocks: 867108
remove me from QA contact
QA Contact: pcheng
This has been noted in the Aurora 23 release notes:

http://www.mozilla.org/en-US/firefox/23.0a2/auroranotes/

If you would like to make any changes or have questions/concerns please contact me directly.
The current setup is complicated IMO. This should be easily doable
 * either by setting the default search engine from the addons screen, where all user-defined search engines are displayed (long press on a search engine, display a modal dialog allowing to set it as default, or from the item's "options" submenu, with a "use as default" checkbox)
 * or from the awesome screen, by long pressing the desired search engine, that opens a modal dialog allowing to set it as the default
(In reply to nodiscc from comment #32)
> The current setup is complicated IMO. This should be easily doable
>  * either by setting the default search engine from the addons screen, where
> all user-defined search engines are displayed (long press on a search
> engine, display a modal dialog allowing to set it as default, or from the
> item's "options" submenu, with a "use as default" checkbox)

There is a context menu item to set the search engine as the default when you long press on it. Are you seeing that?

>  * or from the awesome screen, by long pressing the desired search engine,
> that opens a modal dialog allowing to set it as the default

I think we wanted to avoid redundant UI, but if you file a new bug about this, we could discuss whether or not this is something we should do. Right now we're in the process of changing our awesomescreen UI (see bug 862793), so maybe we could find a place to introduce this as we work on that.
Depends on: 904279
I was lagging a few versions behind the change. Long pressing on a search engine allows setting it as default. I'm fine with this behavior, thanks for your work on this.

RESOLVED FIXED indeed.
Flags: needinfo?(ibarlow)
Depends on: 960251
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: