WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
178776
clipboardData.setData doesn't work on iPhone and iPad
https://bugs.webkit.org/show_bug.cgi?id=178776
Summary
clipboardData.setData doesn't work on iPhone and iPad
Vladislav Deev
Reported
2017-10-25 02:19:55 PDT
In iOS 10.3, iOS 11 i can't add any text in clipboard, using event.clipboardData.setData. I tried to get data, sending to clipboard, but in iOS 10.3, iOS 11 after adding my data in clipboard I got empty string.
Attachments
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2017-10-25 07:49:51 PDT
Should be fixed by (relatively) recent work on clipboard APIs. In particular, <
http://trac.webkit.org/changeset/222228
> which uses StaticPasteboard to stage pasteboard data during copy, and <
https://trac.webkit.org/changeset/222595/webkit
>, which adopts the same technique for drag-and-drop, and also allows bindings to write arbitrarily many custom types during copy/dragstart (previously, later calls to setData would overwrite data supplied by previous calls).
Alexey Proskuryakov
Comment 2
2017-10-25 10:28:59 PDT
Marking as fixed per the above.
Vladislav Deev
Comment 3
2017-10-25 11:12:26 PDT
However, when i trying to add my data with help this "clipboardData.setData", then "clipboardData.getData" sending just a empty string. Is there any chance that bug is still existing? if not, and it is now fixed, would you help with my code?I thought i wrote right, but now i'm doubting. There's the part, where happens adding text: event.preventDefault ? event.preventDefault() : event.returnValue = false; var _newLine = '\n'; var _pagelink = '\u00A9 ' + _escapeHTML(); var _copytext = getSelection() + _newLine + _pagelink; event.clipboardData.setData('Text', _copytext); And is there a function, which can to send data to clipboard for the same situation? P.S. Sorry for my weak English and code, i'm still began learning Javascript:)
Ryosuke Niwa
Comment 4
2017-10-25 11:26:27 PDT
The fix is only on trunk, not even in the latest shipped version of iOS.
Vladislav Deev
Comment 5
2017-10-25 11:42:37 PDT
(In reply to Ryosuke Niwa from
comment #4
)
> The fix is only on trunk, not even in the latest shipped version of iOS.
What's 'trunc'? Test version? If that's true, so I can't see needed effect untill came out version with that fix?
Ryosuke Niwa
Comment 6
2017-10-25 11:57:56 PDT
(In reply to Vladislav Deev from
comment #5
)
> (In reply to Ryosuke Niwa from
comment #4
) > > The fix is only on trunk, not even in the latest shipped version of iOS. > > What's 'trunc'? Test version? > If that's true, so I can't see needed effect untill came out version with > that fix?
You can test it in iOS simulator if you followed instructions on:
https://github.com/WebKit/webkit
but it's a lot more involved than just installing Safari Technology Preview on macOS because you'd have to build it yourself :(
Vladislav Deev
Comment 7
2017-10-27 02:49:27 PDT
The problem still exists. Can anybody help with that problem? I can send version IOS, if that needs.
Wenson Hsieh
Comment 8
2017-10-27 07:37:40 PDT
(In reply to Vladislav Deev from
comment #7
)
> The problem still exists. > Can anybody help with that problem? I can send version IOS, if that needs.
Did you build trunk WebKit and run in the simulator as Ryosuke mentioned, or did you just try on device? As these fixes have not shipped, it is expected that shipping software would still exhibit this bug.
Ryosuke Niwa
Comment 9
2017-10-27 22:55:59 PDT
(In reply to Vladislav Deev from
comment #7
)
> The problem still exists. > Can anybody help with that problem? I can send version IOS, if that needs.
Like I stated, the problem exists in all shipping iOS versions. However, it's fixed on trunk WebKit. To track issues with releases of iOS, please file a radar instead:
https://bugreport.apple.com
Closing the bug again.
Radar WebKit Bug Importer
Comment 10
2017-11-15 12:47:20 PST
<
rdar://problem/35568132
>
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