Closed Bug 1225842 Opened 4 years ago Closed 4 years ago

Can't add a search engine via OpenSearchDescription

Categories

(Firefox for Android :: Settings and Preferences, defect)

42 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 47
Tracking Status
firefox45 + fixed
firefox46 + fixed
firefox47 + verified
fennec + ---

People

(Reporter: bugzilla.mozilla.org-01, Assigned: Margaret)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:42.0) Gecko/20100101 Firefox/42.0
Build ID: 20151030085317

Steps to reproduce:

- Open a webpage that contains an OpenSearchDescription (wikipedia, duckduckgo, ...)
- try to add the search engine to firefox:
  - I tried menu-button > page > add search engine (in my german version: menu-button > Seite > Suchmaschine hinzufügen) but this option is deactivated
  - the search settings do not have an option to add a search engine 


Actual results:

- it is possible to add a search engine by long-pressing an input, but this does not obey the OpenSearchDescription


Expected results:

- I want to add what is specified in the OpenSearchDescription of the page, even if there is no search form on the page
Flags: needinfo?(kbrosnan)
Confirmed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(kbrosnan)
Florian, any idea if recent search service changes might have cause this.

Also, as part of fixing this, we should write a test.
tracking-fennec: --- → ?
Flags: needinfo?(florian)
This is not really recent, Firefox for Android 43 has the same behavior.
(In reply to :Margaret Leibovic from comment #2)
> Florian, any idea if recent search service changes might have cause this.
> 
> Also, as part of fixing this, we should write a test.

I can't think of anything that could have caused this, no.

note: The two engines mentioned in the description here (wikipedia, duckduckgo) are engines we ship by default (at least on Firefox desktop, but I think on Android too). Adding an engine with the same name as an existing engine isn't supported, so the bug exactly as described here isn't really a bug. But I verified with another engine (ecosia.org) that the "add search engine" menu item is indeed disabled for no obvious reason.
Flags: needinfo?(florian)
Also doesn't work on the mobile version of qwant when you follow their install tutorial.
I'll take a look at this (and write a test!).
Assignee: nobody → margaret.leibovic
tracking-fennec: ? → +
Duplicate of this bug: 1241836
This was caused by bug 935259.

makeOpenSearchMessage returns undefined here:
http://hg.mozilla.org/mozilla-central/annotate/f53533d9eb77/mobile/android/chrome/content/browser.js#l4140

Instead of making a message to return, we should just send that message asynchronously.
Blocks: 935259
Keywords: regression
I verified this works locally, but I'm also working on a robocop test.
Attachment #8716382 - Flags: review?(liuche) → review+
Comment on attachment 8716382 [details]
MozReview Request: Bug 1225842 - Properly send message to update open search state. r=liuche

https://reviewboard.mozilla.org/r/33807/#review31335
https://hg.mozilla.org/integration/fx-team/rev/438b42019921171cdbcbad79dc216d185cad1b5f
Bug 1225842 - Properly send message to update open search state. r=liuche
Depends on: 1248495
(In reply to :Margaret Leibovic from comment #11)
> https://treeherder.mozilla.org/#/jobs?repo=try&revision=9decb3673846

I don't want to block landing this on getting a this test working, so I filed bug 1248495 as a follow-up.
https://hg.mozilla.org/mozilla-central/rev/438b42019921
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Comment on attachment 8716382 [details]
MozReview Request: Bug 1225842 - Properly send message to update open search state. r=liuche

Approval Request Comment
[Feature/regressing bug #]: Bug 935259.

[User impact if declined]: Can't add open search engines.

[Describe test coverage new/current, TreeHerder]: No automated tests (working on that in a follow-up), but tested locally.

[Risks and why]: Low-risk, really small and simple patch to fix some busted logic.

[String/UUID change made/needed]: None.
Attachment #8716382 - Flags: approval-mozilla-beta?
Attachment #8716382 - Flags: approval-mozilla-aurora?
Comment on attachment 8716382 [details]
MozReview Request: Bug 1225842 - Properly send message to update open search state. r=liuche

Tested manually, ok to uplift to aurora.
Attachment #8716382 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Tested using:
Device: One A2001 (Android 5.1.1) 
Build: Firefox for Android 47.0a1 (2016-02-18)

Steps:
-Remove google as a search engine from settings
-Navigate to google.com
-Open Menu -> Page 
=> 'Add a Search Engine' is greyed out
Is it expected?
Flags: needinfo?(margaret.leibovic)
(In reply to Teodora Vermesan (:TeoVermesan) from comment #21)
> Tested using:
> Device: One A2001 (Android 5.1.1) 
> Build: Firefox for Android 47.0a1 (2016-02-18)
> 
> Steps:
> -Remove google as a search engine from settings
> -Navigate to google.com
> -Open Menu -> Page 
> => 'Add a Search Engine' is greyed out
> Is it expected?

It's expected that it's greyed out if you already have the search engine installed:
http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js#3979

Could you try with a site where you don't have the search engine already installed (e.g. Bugzilla)?
Flags: needinfo?(margaret.leibovic)
I removed all search engines from Settings. Only "Twitter" remained as a search engine.
Going to yahoo.com, duckduckgo.com, bugzilla and trying to add them as a search engine. works ok. But only bugzilla appears in Settings. Yahoo and Duckduck don't appear.
And "Add as a search engine" is greyed out with google.com, amazon.com, bing.com
(In reply to Teodora Vermesan (:TeoVermesan) from comment #23)
> I removed all search engines from Settings. Only "Twitter" remained as a
> search engine.
> Going to yahoo.com, duckduckgo.com, bugzilla and trying to add them as a
> search engine. works ok. But only bugzilla appears in Settings. Yahoo and
> Duckduck don't appear.
> And "Add as a search engine" is greyed out with google.com, amazon.com,
> bing.com

It is going to be greyed out for any search engine that comes pre-installed with the app, since those are never actually removed, only hidden.

You could file a separate bug to track this issue, but this is the way this has always behaved, so not a problem associated with fixing this regression here.
Testing on Nexus 6 (Android 6.0) with 47.0a1 (2016-02-18), "Add as a search engine" is greyed out for yandex.com, imdb.com, fandango.com, ask.com, aol.com.
Comment on attachment 8716382 [details]
MozReview Request: Bug 1225842 - Properly send message to update open search state. r=liuche

Just like liz, taking it;
Should be in 45 beta 8
Attachment #8716382 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Tested using:
Nexus 9 (Android 6.0.1)
-"Add as a search engine" is greyed out for ask.com, aol.com, fandango.com
-"Add as a search engine" is ok with imdb.com, bugzilla.mozilla.org, yandex.com

Nexus 6 (Android 6.0.1)
-"Add as a search engine" is greyed out for yandex, imdb, ask, aol, fandango
-"Add as a search engine" is ok with bugzilla
- imdb, yandex work ok with Request Desktop Site
- ask, aol, fandango don't

One A2001 (Android 5.1.1) 
-"Add as a search engine" is greyed out for imdb, yandex, fandango, ask, aol
-"Add as a search engine" is ok with bugzilla
- imdb, yandex works ok with Request Desktop Site
- ask, aol, fandango don't

lenovo tablet 2 (Android 4.4.2) 
-"Add as a search engine" is greyed out for ask, aol, fandango
-"Add as a search engine" is ok  with imdb, bugzilla, yandex

Asus zenpad (Android 5.0.2)
-"Add as a search engine" is greyed out for aol, ask, fandago
-"Add as a search engine" works ok with imdb, yandex, bugzilla
You need to log in before you can comment on or make changes to this bug.