Closed
Bug 556061
Opened 15 years ago
Closed 14 years ago
Copying location of a "switch to" action copies moz-action
Categories
(Firefox :: Address Bar, defect)
Firefox
Address Bar
Tracking
()
VERIFIED
FIXED
People
(Reporter: zpao, Assigned: zpao)
References
Details
(Whiteboard: [switch-to-tab])
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
You highlight the text in the location bar and it copies the moz-action: at the offset. So you can never actually copy the fill URL (or X characters off the end)
Comment 1•15 years ago
|
||
Probably want to add some _parseActionUrl magic to _getSelectedValueForClipboard.
Assignee | ||
Comment 2•15 years ago
|
||
(In reply to comment #1)
> Probably want to add some _parseActionUrl magic to
> _getSelectedValueForClipboard.
Yea I saw that. Alternatively (in other words what I've done so far) you can use the actual inputField.
The only "tricky" thing is when you cut, depending on how you do it, the action moz-action stays and you can still switch tabs or it wipes out the moz-action stuff. I'm thinking the 2nd is better (and that's how I did it).
Note: I don't think I had to change all of the urlbar.selectionStart to urlbar.inputField.selectionStart, but it looks more consistent.
Comment 3•15 years ago
|
||
Comment on attachment 436136 [details] [diff] [review]
Patch v0.1 (WIP)
>diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml
> <method name="_getSelectedValueForClipboard">
>- var val = this.value.substring(this.selectionStart, this.selectionEnd);
>+ // Grab the actual input field's value, not our value, which could include moz-action:
>+ var val = this.inputField.value.substring(this.inputField.selectionStart, this.inputField.selectionEnd);
I would avoid the changes for selectionStart/selectionEnd, I don't think there's any real clarity benefit to getting them from .inputField just because that's where you also get the value.
> // If the entire value is selected and it's a valid non-javascript,
> // non-data URI, encode it.
> if (val == this.value &&
Seems like this should use inputField.value too. Probably worth putting it into a temporary.
Assignee | ||
Comment 4•15 years ago
|
||
Now with a test and less inputField.selectionStart/End
Assignee: nobody → paul
Attachment #436136 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #437482 -
Flags: review?(gavin.sharp)
Comment 5•15 years ago
|
||
Comment on attachment 437482 [details] [diff] [review]
Patch v0.2
Worth testing this test on linux, selection clipboard might cause issues there.
I think you need to change the test to poll the clipboard to avoid random oranges (see e.g. browser_410196_paste_into_tags.js and browser_bug321000.js) - r- because of that.
Patch looks good otherwise, though I'd probably use a temporary for this.inputField.value in _getSelectionForClipboard.
Attachment #437482 -
Flags: review?(gavin.sharp) → review-
Comment 6•15 years ago
|
||
This is a bad regression... Requesting blocking for 1.9.3.
Assignee | ||
Comment 7•14 years ago
|
||
Now with polling tests & used a temp var to save a value lookup. I'll push to try to see how Linux goes.
Attachment #437482 -
Attachment is obsolete: true
Attachment #445172 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Attachment #445172 -
Flags: review? → review?(gavin.sharp)
Comment 8•14 years ago
|
||
just passing,
+ // This should reset any "moz-action;" prefix.
I guess you wanted to put a colon there and not a semicolon.
PS: I love the fact you wait for clipboard, well done!
Updated•14 years ago
|
Attachment #445172 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 9•14 years ago
|
||
Pushed http://hg.mozilla.org/mozilla-central/rev/3ae424ac844a (with comment fix).
You need to log in
before you can comment on or make changes to this bug.
Description
•