Open Bug 1839038 Opened 3 years ago Updated 1 year ago

Ability to copy decoded URLs but leave spaces encoded

Categories

(Firefox :: Address Bar, enhancement, P3)

Firefox 114
enhancement

Tracking

()

People

(Reporter: wctaiwan, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: papercut, Whiteboard: [sng-scrubbed][search-papercut])

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0

Steps to reproduce:

  1. Set browser.urlbar.decodeURLsOnCopy to true in about:config
  2. Go to a page where the path in the URL contains a space
  3. Select the URL in the address bar and copy it
  4. Paste it in a different application

Actual results:

The URL is copied verbatim, with the space decoded as well.

Expected results:

I would like some way to copy URLs with everything except spaces decoded.

browser.urlbar.decodeURLsOnCopy is extremely helpful for CJK users since a URL like https://zh.wikipedia.org/wiki/阻斷服務攻擊 otherwise becomes https://zh.wikipedia.org/wiki/%E9%98%BB%E6%96%B7%E6%9C%8D%E5%8B%99%E6%94%BB%E6%93%8A, which is much less readable. However, many applications automatically convert URLs into hyperlinks and tokenize on spaces, meaning that with decodeURLsOnCopy enabled, URLs with spaces would not be correctly hyperlinked. (This is especially painful when sharing URLs with other people.)

An option to decode everything except spaces (or changing decodeURLsOnCopy to exempt spaces) would solve both of these issues.

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

Thank you for submitting this enhancement.
Setting as NEW so the developers can have a look.

Status: UNCONFIRMED → NEW
Ever confirmed: true

I tested with Edge and they seem to keep %20 encoded, so it's easier to paste into other documents.
The only thing to verify is how we want to handle javascript: URLs as not decoding spaces could make the bookmarklet unreadable. we could maybe only apply this enhancement to http(s)?

Severity: -- → N/A
Keywords: papercut
Priority: -- → P3
Whiteboard: [sng-scrubbed][search-papercut]
You need to log in before you can comment on or make changes to this bug.