Readonly Omnibox allows paste |
||||||
Issue descriptionVersion: 51.0.2688.0 OS: Win7 What steps will reproduce the problem? (1) Visit http://ericlawrence.com. (2) Click a comment link to do a window.open with "location=0" in the options string (3) In the window that opens, paste a URL in the omnibox and hit enter. What is the expected output? Expect either paste is blocked (since omnibox is readonly) or paste is allowed and hitting enter navigates. What do you see instead? URL pastes into box. Instead of navigating, hitting Enter deletes the pasted URL and the text reverts to the current URL. (Repro Win,CrOs. Not repro on OSX)
,
Mar 23 2016
I have someone who might work on this ... will cc him as soon as we get him an account.
,
Mar 24 2016
IsCommandIdEnabled(IDS_APP_PASTE) checks if |editable| https://code.google.com/p/chromium/codesearch#chromium/src/ui/views/controls/textfield/textfield.cc&sq=package:chromium&type=cs&l=1245&rcl=1458819216 but OmniboxViewViews::ExecuteCommand(int command_id, int event_flags) does not check it: case IDS_APP_PASTE: OnPaste(); return; default: if (Textfield::IsCommandIdEnabled(command_id)) The following patch seems to resolve the problem: --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc @@ -370,7 +370,9 @@ void OmniboxViewViews::ExecuteCommand(int command_id, int event_flags) { // These commands do invoke the popup. case IDS_APP_PASTE: + if (Textfield::IsCommandIdEnabled(command_id)) { OnPaste(); + } return;
,
Mar 24 2016
Sounds like this will be simple to review and land. You'll want to follow the instructions on http://dev.chromium.org/developers/contributing-code for how to proceed with getting your patch landed.
,
Mar 25 2016
https://codereview.chromium.org/1833133002/
,
Apr 29 2016
,
Apr 29 2016
,
Feb 16 2017
This was fixed last June. https://chromium.googlesource.com/chromium/src/+/8ca173a988171b43b6686335335f816a0ff27403 https://cs.chromium.org/chromium/src/chrome/browser/ui/views/omnibox/omnibox_view_views.cc?type=cs&l=846 |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by pkasting@chromium.org
, Mar 23 2016Labels: OS-Linux
Status: Available (was: Untriaged)
Summary: Readonly Omnibox allows paste (was: Readonly Omnibox allows paste, but navigation does not occur)