Open Bug 1474179 Opened 6 years ago Updated 2 years ago

Add a "copy raw" item in the popup menu of the address bar when the URL is encoded, and in this case, let the "copy" item copy the decoded URL

Categories

(Firefox :: Address Bar, enhancement, P5)

enhancement

Tracking

()

Tracking Status
firefox63 --- affected

People

(Reporter: zjz, Unassigned)

Details

Attachments

(4 files)

I know the user can copy a decoded URL by turning on browser.urlbar.decodeURLsOnCopy in about:config, but I really think it's worth bringing the feature to the UI.

Nowadays, almost all mordern user agents recognize a decoded URL, and users definitely would prefer a readable URL, it's especially useful when someone is developing a website with heavy Unicode URL path names, or even with a Unicode domain name! If the mordern user agent doesn't directly support copying decoded URLs in its UI, then it would be a very terrible thing for promoting websites of such kind(Because almost all visitors will share ugly URLs, which is almost impossible to remember, to other people).

I suggest removing browser.urlbar.decodeURLsOnCopy. We can always let the "copy" menu item copy the decoded URL, what we JUST need to is to add an additional menu item "copy raw" ONLY WHEN the URL is encoded.
Summary: Add a "copy raw" in the popup menu of the address bar when the URL is encoded → Add a "copy raw" item in the popup menu of the address bar when the URL is encoded, and in this case, let the "copy" item copy the decoded URL
Assignee: nobody → zjz
The two URLs can be used to test the patch:

https://zh.wikipedia.org/wiki/Mozilla基金會
http://nic.网址

After page loads, select the whole URL, and popup the menu, then the "copy raw" menuitem will be visible.
Priority: -- → P5
Status: NEW → ASSIGNED
Comment on attachment 8991665 [details]
Bug 1474179 - Part 1: Removes browser.urlbar.decodeURLsOnCopy, and always lets "copy" menuitem copy the Unicode URL, if any.

https://reviewboard.mozilla.org/r/256586/#review263994

Handing off the review to Marco who is a Firefox peer.
Attachment #8991665 - Flags: review?(valentin.gosu)
Attachment #8991665 - Flags: review?(mak77)
Attachment #8991666 - Flags: review?(valentin.gosu) → review?(mak77)
Attachment #8991667 - Flags: review?(valentin.gosu) → review?(mak77)
Attachment #8991668 - Flags: review?(valentin.gosu) → review?(mak77)
off-hand "Copy Raw" will be unclear to most users, I can't imagine how hard it will be to translate it.
We'll need a more understandable label.

Anyway, I think I'm unable to make a call by myself here, so I'll set a couple additional needinfo to collect feedback.
Flags: needinfo?(gijskruitbosch+bugs)
Flags: needinfo?(adw)
I am wondering if we can make things the other way around: let "copy" work as before, and change "copy raw" to "copy readable"
This seems pretty hairy considering how we already have issues with how decoding the URI produces a different URI when re-encoded...

What do other browsers do?
Flags: needinfo?(gijskruitbosch+bugs)
I don't have other browsers installed except Chrome, I can just confirm currently the Chrome just copies the encoded URL.

That said, what other browsers do don't always mean a perfect solution.

What about:

let "copy" work as before, and change "copy raw" to "copy readable", and use a blacklist mechanism: only show "copy readable" when the scheme is what we have considered safe, e.g. "http", "https", "ftp", .... For all other schemes, "copy readable" never shows.
typo

s/blacklist/whitelist/
IMO another menu item will probably confuse the average user, so I don't think it should be present by default.  Maybe we could enable it when the user has taken some action, like setting devtools.chrome.enabled or some other new pref specifically for this.  Other than that this seems better left to an extension.  (But I don't know whether webextensions can even modify this menu.  If not, it could be a browser/page action at least.)
Flags: needinfo?(adw)
Personally, I still think when the user copies a URL(like with long Unicode title) and paste to see a quite different-looking URL, that confuses the average user either.
Some might even consider the URL a malious address.

Tech guys figure out the method by inputing a character and then deleting the character and then copy the URL when sharing URL, but averages users most unlikely will realize the method, if they try serveral times and still failed to get the pretty URL, they just give up.
Comment on attachment 8991665 [details]
Bug 1474179 - Part 1: Removes browser.urlbar.decodeURLsOnCopy, and always lets "copy" menuitem copy the Unicode URL, if any.

It looks like there's no agreement around this, thus I don't feel like to proceed with a formal review.

This doesn't mean there's no problem here, I think we all agree this is not proper atm. browser.urlbar.decodeURLsOnCopy is not an optimal solution, because it's all white or all black, no way to have both behaviors.

Personally I like the idea of allowing WebExtensions to add items to the Address bar context menu, and that could be a good path forward in general.
Attachment #8991665 - Flags: review?(mak77)
Attachment #8991666 - Flags: review?(mak77)
Attachment #8991667 - Flags: review?(mak77)
Attachment #8991668 - Flags: review?(mak77)
Assignee: zjz → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: