Closed Bug 2031099 Opened 25 days ago Closed 14 days ago

Spaces encoded without + in URL with Custom Search Engines

Categories

(Firefox :: Search, defect)

Firefox 149
defect

Tracking

()

RESOLVED MOVED

People

(Reporter: sergegardien, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:149.0) Gecko/20100101 Firefox/149.0

Steps to reproduce:

  1. Open about:config.
  2. Search for browser.urlbar.update2.engineAliasRefresh.
  3. Click the + button to enable the preference.
  4. Navigate to about:preferences#search.
  5. Click the Add button to create a new search engine.
  6. Add a Google custom search engine with the following URL:
    https://www.google.com/search?q=%s
  7. Perform a search using multiple terms, for example:
    This is a test
  8. Copy and paste the resulting URL from the address bar into another application or text field.

Actual results:

The resulting URL contains literal spaces instead of encoded ones. For example:

https://www.google.com/search?q=This is a test

Because the spaces are not encoded, copying and pasting the URL into other applications may cause it not to be recognized as a single valid link.

This issue is similar to, but distinct from, the previously resolved bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1948541

Expected results:

Spaces in the search query should be encoded using +, as in previous Firefox behavior. The resulting URL should be:

https://www.google.com/search?q=This+is+a+test

Encoding spaces with + ensures the URL is valid and recognized correctly when copied and pasted or shared.

The Bugbug bot thinks this bug should belong to the 'Firefox::Address Bar' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Address Bar
Component: Address Bar → Search

Is the value of the browser.urlbar.decodeURLsOnCopy pref currently set to true (which would keep the spaces in the URL)?

Also note that browser.urlbar.update2.engineAliasRefresh in the STR's in Step 2 is no longer needed, as this capability is available broadly 🙂

Flags: needinfo?(sergegardien)

I've checked browser.urlbar.decodeURLsOnCopy, and it is set to false. Despite that, the copied URL still contains literal spaces instead of encoded ones.

Thanks for the clarification regarding browser.urlbar.update2.engineAliasRefresh.

Flags: needinfo?(sergegardien)

Unfortunately we're not able to reproduce this. So a few additional questions:

  • Does this reproduce if you're pasting back into Firefox onto a page?
  • Does it happen with the Google search engine that's provided by Firefox?
  • Does it happen with a fresh profile?
Flags: needinfo?(sergegardien)

To answer your questions:

  1. yes
  2. I don't have anymore the Google Search Engine provided by Firefox and I cannot find an easy way to re-add it without resetting all the search engines I configured
  3. Actually with a fresh profile everything looks fine.

That said, the profile where I've seen the issue has been created from scratch not long ago to fix some unrelated issues I was having. I have applied some changes to the about:config of this profile and installed some extensions (noscript, ublock, etc.) but the issue with the space encoding appeared out of the blue after a version update of Firefox, otherwise it was absent.

Flags: needinfo?(sergegardien)

I tried the Troubleshooting Mode and the problem disappeared so I figured it was caused by an extension and indeed it was this one:
https://addons.mozilla.org/en-GB/firefox/addon/clearurls/

I just reported this bug on the GitHub issue page of the addon:
https://github.com/ClearURLs/Addon/issues/511

Thank you for identifying that. I'll mark this a moved to a different tracker, as this is not something in Firefox itself.

Status: UNCONFIRMED → RESOLVED
Closed: 14 days ago
Resolution: --- → MOVED
You need to log in before you can comment on or make changes to this bug.