blob: a0ad1386f31cdf93634b530e8c44046062905a47 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<div id="destination" contenteditable="true" style="width: 500px; height: 100px; border: solid red 1px"></div>
<iframe id="iframe" src="../resources/abe.png" onload="selectInFrame()"></iframe>
</body>
<script>
function selectInFrame() {
if (window.internals)
window.internals.settings.setPreferMIMETypeForImages(true);
var iframe = document.getElementById("iframe");
var iframeDocument = iframe.contentDocument;
var destination = document.getElementById("destination");
iframeDocument.body.focus();
iframeDocument.execCommand("SelectAll");
iframeDocument.execCommand("Copy");
destination.focus();
document.execCommand("Paste");
}
</script>
</html>