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

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: Use the IO thread on Windows. 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) => {
dcheng 2016/07/20 07:02:17 Apparently I don't know JS^WES6.
+ Array.prototype.forEach.call(event.clipboardData.items, (item) => {
+ if (item.type != 'text/rtf') {
+ return;
+ }
+ item.getAsString((s) => {
+ document.title = s;
+ });
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698