Bug 171907

Summary: Web Inspector: Copy to clipboard fails via InspectorFrontendHostStub
Product: WebKit Reporter: Ross Kirsling <ross.kirsling>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, joepeck
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

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
Patch (1.84 KB, patch)
2017-05-10 11:22 PDT, Ross Kirsling
no flags
Ross Kirsling
Comment 1 2017-05-09 20:22:21 PDT
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
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.