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)
Probably want to add some _parseActionUrl magic to _getSelectedValueForClipboard.
(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.
Now with a test and less inputField.selectionStart/End
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-
Now with polling tests & used a temp var to save a value lookup. I'll push to try to see how Linux goes.
9 years ago
Attachment #445172 - Flags: review? → review?(gavin.sharp)
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!
Attachment #445172 - Flags: review?(gavin.sharp) → review+
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.