Open Bug 1310666 Opened 8 years ago Updated 5 months ago

The second %s in Alias Search is not expanded to search term for User Search Engines

Categories

(Firefox :: Search, defect, P5)

52 Branch
defect

Tracking

()

REOPENED

People

(Reporter: artur, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Build ID: 20161016030205 Steps to reproduce: When I open a web form, there are two text fields filled with data from the URL. In Keyword Search I manually added the second %s what fills another text field with the same value. Keyword search https://myservice/showsomething.php?start=%s&end=%s Actual URL: https://myservice/showsomething.php?start=1234&end=1234 Linux 3.13.0-95-generic #142-Ubuntu SMP Fri Aug 12 17:00:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Firefox 52.0a1 Actual results: Web form: Start: 1234 End: %s Expected results: Web form: Start: 1234 End: 1234
Status: NEW → UNCONFIRMED
Component: Untriaged → Layout: Form Controls
Ever confirmed: false
Product: Firefox → Core

I'm still seeing this in Firefox 107.0a1.
Chromium does expand the second %s.

Component: Layout: Form Controls → Address Bar
Product: Core → Firefox

The code seems to expand any %s https://searchfox.org/mozilla-central/rev/ffa4d00965c5281def6d3ddcbcdf6259d38c9b9a/toolkit/modules/KeywordUtils.sys.mjs#85-90

I tried creating a bookmark with the given url and assigning a keyword, and both %s were replaced for me.
Could you please post a screenshot of when you are settings this Keyword Search field, or a short screen cast?

Flags: needinfo?(artur)

Nightly 107.0a1 resolves all %s to the searched string properly.
From my point of view, the bug can be closed.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(artur)
Resolution: --- → WORKSFORME

Search URL: https://www.google.com/search?q=%s+%s
Keyword: test

Attached image Search result

Nightly 107.0a1 (2022-10-10) Win/64.

I type "test foo" in the address bar.

Expected: Google search results for "foo foo".
Actual: Google searches for "foo %s" are displayed.

I cannot reproduce that behavior, I tried the url in comment 4 and it replaces both %s for me. I'm testing with Nightly on Win10.

I've reproduced this in a new Firefox profile. The only setting I changed was setting browser.urlbar.update2.engineAliasRefresh=true before adding the search shortcut.

Also testing with Nightly on Win10.

Attached file about:support

I tried a fresh download of the en-US version of Nightly, on a VM with no previous Firefox install. I still only get one %s substitution.

(In reply to Marco Bonardo [:mak] from comment #2)

The code seems to expand any %s https://searchfox.org/mozilla-central/rev/ffa4d00965c5281def6d3ddcbcdf6259d38c9b9a/toolkit/modules/KeywordUtils.sys.mjs#85-90
Yes, but that code also appears to replace both "%s" and "%S":
url = url.replace(/%s/g, encodedParam).replace(/%S/g, param);
However if I create a search shortcut with %S in the URL (i.e. https://www.google.com/search?q=%S) no substitution occurs.

I see, this is Search Engine Alias, not Bookmark keywords. Bookmark keywords work as expected.

I'll confirm this as a Search bug, though note browser.urlbar.update2.engineAliasRefresh is not officially supported yet.

Component: Address Bar → Search
Summary: The second %s in Keyword Search is not expanded to search term → The second %s in Alias Search is not expanded to search term
Blocks: 648398
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: WORKSFORME → ---
Severity: normal → S3
Blocks: search-alias
Priority: -- → P5
Summary: The second %s in Alias Search is not expanded to search term → The second %s in Alias Search is not expanded to search term for User Search Engines

See also: Bug 1893594.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: