Closed Bug 1813776 Opened 3 years ago Closed 1 year ago

Remove the search string (URL) validation in "Add search engine"

Categories

(Firefox for Android :: Search, defect, P3)

All
Android
defect

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: csadilek, Assigned: royang)

References

Details

(Whiteboard: [fxdroid][group3])

Attachments

(1 file)

From github: https://github.com/mozilla-mobile/fenix/issues/25867.

    It's in general pretty much useless and in some cases counter-productive: preventing useful things like "https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=%s" being added.
    Related: #9831, #10605, #11332

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

Component: General → Search

The severity field is not set for this bug.
:skhan, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(skhan)
Severity: -- → S3
Flags: needinfo?(skhan)
Priority: -- → P3

I think this could use a description of what is wrong with the current validation, and what it prevents.

I think there should be at least some validation to avoid the user putting in something totally random that won't work, e.g. is it a valid URL (if %s is replaced), does it have a %s?

This bug makes it impossible to add search engines like https://nitter.poast.org/search?f=tweets&q=%s&e-nativeretweets=on.

Breaking a feature for everyone to protect a user that will "enter something totally random that won't work" from himself doesn't seem reasonable.

Even if there was an unlikely large number of people entering random texts into the field and then filing bug reports because their random texts aren't working as searches, all you'd have to do was point those people to a support article and close the bug.

When testing the URL, the "add search page" attempts to make a connection to the server. In the case of comment 0 it changes:

  • https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=%s
    to
  • https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=1

However, Google sees that 1 isn't a web page, and so returns 400, this replicates on desktop as well. If I try it on desktop with changing the 1 to a URL then it works.

In the case of comment 4, I'm not quite sure what is going on. https://nitter.poast.org/search?f=tweets&q=1&e-nativeretweets=on returns 500, but works fine when I load it in a browser.

I'm guessing the intent was to make sure that the server has been typed correctly, so maybe we should relax the check to "any server that returns a response", rather than the server having to return a 2xx response.

This also affects IMDb: https://www.imdb.com/find/?q=%s&s=tt returns 500.

If you still believe that it is important to validate custom search URLs on Android, couldn't you disable the current code altogether until you have enough time to work on a better validation logic?

Assignee: nobody → royang
Whiteboard: [fxdroid][group3]
See Also: → 1967794

Created Bug 1967794 as a follow up. I will remove URL validation with this issue.

Pushed by royang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8c4ab0f87eb1 Remove URL validation in custom search engine settings. r=android-reviewers,tchoh,android-l10n-reviewers,delphine
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
Duplicate of this bug: 1968338
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: