Copied URL from loading new tab does not include https:// scheme
Categories
(Firefox :: Address Bar, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox130 | --- | verified |
People
(Reporter: maltejur, Assigned: mak)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sng])
Attachments
(2 files, 1 obsolete file)
To reproduce:
- Open https://httpstat.us/200?sleep=5000 in a new tab
- While the page is loading, copy the URL from the loading tab
Expected result: The clipboard contains https://httpstat.us/200?sleep=5000
Actual result: The clipboard contains httpstat.us/200?sleep=5000
Assignee | ||
Comment 1•5 months ago
|
||
I cannt reproduce this, if I click on the url and ctrl+C.
Did you reproduce in Nightly?
How do you focus the urlbar and copy?
Reporter | ||
Comment 2•5 months ago
|
||
I can reproduce this in a fresh profile in the 2024-06-17 Nightly build, I have attached a screen recording of this happening. I have tried the following methods to copy the URL and always get the same URL without a scheme:
- Click in the address bar, then Ctrl+C
- Click in the address bar, then right click and copy through the context menu
- Right click the address bar directly and copy through the context menu
Assignee | ||
Comment 3•5 months ago
|
||
We are trimming the pasted string? What do you see if you paste into an external app?
Reporter | ||
Comment 4•5 months ago
|
||
No, that does not seem to be the issue. I also get the same trimmed string when I paste the clipboard into a different program.
Assignee | ||
Updated•5 months ago
|
Updated•5 months ago
|
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Comment 5•5 months ago
•
|
||
When switching the tab we call setURI
, pageproxystate
is invalid
yet, as we're still loading the page, thus no locationchange was received.
setURI
sets .valueIsTyped = true
, then _getSelectedValueForClipboard
thinks there's a typed string and just copies the selection.
I'm not sure what's the point of setting valueIsTyped
to true in setURI
, I'll investigate that (it's apparently from https://bugzilla.mozilla.org/show_bug.cgi?id=668019).
Assignee | ||
Comment 6•5 months ago
|
||
The valueIsTyped
property was introduced mostly to modify the copy behavior,
though it's misleading since it's also used by setURI, and it's not taking
into account other cases where the url is trimmed.
This removes it in favor of using the more precise userTypedValue
and
_protocolIsTrimmed
.
This is properly passing the untrimmedUrl value in the autofill case, also
renaming untrimmedValue
to untrimmedUrl
as the only case where it makes
sense to pass it is when it's a URL.
Comment 7•5 months ago
|
||
Comment on attachment 9413256 [details]
WIP: Bug 1903266 - Stop relying on valuesIsTyped
to decide what to copy from the address bar.
Revision D216810 was moved to bug 1908360. Setting attachment 9413256 [details] to obsolete.
Assignee | ||
Comment 8•4 months ago
|
||
Comment 10•4 months ago
|
||
bugherder |
Comment 11•4 months ago
|
||
Reproducible on a 2024-06-18 on a Nightly build on Windows 10.
Verified as fixed on Firefox Nightly 130.a1 on Windows 10, Ubuntu 22, macOS 14.
Description
•