WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
171907
Web Inspector: Copy to clipboard fails via InspectorFrontendHostStub
https://bugs.webkit.org/show_bug.cgi?id=171907
Summary
Web Inspector: Copy to clipboard fails via InspectorFrontendHostStub
Ross Kirsling
Reported
2017-05-09 20:14:03 PDT
Verification steps: 1. Ensure that InspectorFrontendHostStub is being used, or at the least, that InspectorFrontendHost.copyText is overridden to the stub implementation. 2. Do something that copies to the clipboard (e.g. Copy as cURL). -- Clipboard is not updated (console error: "Clipboard access is denied"). Details: - The copyText stub is calling document.execCommand("copy"), but there's no current selection, so this is guaranteed to fail. - More specifically, instead of setting up the text to copy as a selection, we're just setting an unused field _textToCopy, which is a remnant of the old Inspector:
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js?rev=154828
Attachments
Patch
(1.84 KB, patch)
2017-05-09 20:22 PDT
,
Ross Kirsling
no flags
Details
Formatted Diff
Diff
Patch
(1.84 KB, patch)
2017-05-10 11:22 PDT
,
Ross Kirsling
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Ross Kirsling
Comment 1
2017-05-09 20:22:21 PDT
Created
attachment 309574
[details]
Patch
Joseph Pecoraro
Comment 2
2017-05-10 10:52:16 PDT
Comment on
attachment 309574
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=309574&action=review
r=me
> Source/WebInspectorUI/UserInterface/Base/InspectorFrontendHostStub.js:124 > + const textarea = document.createElement("textarea");
Nit: We would typically use `let` instead of const, but it doesn't really matter. Our style for when we use `const` tends to be when the value is the equivalent of a compile time constant. So `const timeToWait = 1000;" but not `const timeToWait = x * y;`. Maybe we should change that style though.
Ross Kirsling
Comment 3
2017-05-10 11:22:04 PDT
Created
attachment 309619
[details]
Patch
WebKit Commit Bot
Comment 4
2017-05-10 11:53:37 PDT
Comment on
attachment 309619
[details]
Patch Clearing flags on attachment: 309619 Committed
r216602
: <
http://trac.webkit.org/changeset/216602
>
WebKit Commit Bot
Comment 5
2017-05-10 11:53:38 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug