Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1069)

Unified Diff: content/test/data/paste_listener.html

Issue 2146323002: Expose RTF content on the clipboard as strings to pages when pasting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BrowserTestClipboardScope. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/test/data/paste_listener.html
diff --git a/content/test/data/paste_listener.html b/content/test/data/paste_listener.html
new file mode 100644
index 0000000000000000000000000000000000000000..2c96faf32d938f12896c79f4e0e0dc5731d5274b
--- /dev/null
+++ b/content/test/data/paste_listener.html
@@ -0,0 +1,15 @@
+<title>Waiting for paste</title>
+<body>
+<script>
+document.body.contentEditable = true;
+document.body.addEventListener('paste', (event) => {
+ Array.prototype.forEach.call(event.clipboardData.items, (item) => {
+ if (item.type != 'text/rtf') {
+ return;
+ }
+ item.getAsString((s) => {
+ document.title = s;
+ });
+ });
+});
+</script>
« no previous file with comments | « content/renderer/webclipboard_impl_browsertest.cc ('k') | third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698