Hi All,
I am using a textarea in the popup.html to display output text. Since
there is no right-click menu item of 'copy' to let user to copy
selection out (even ctrl-c works), I am thinking to add a button to do
so. However, looks document.execCommand("copy"); doesn't work from
popup. Any workaround? Thanks. Arthur
My test popup.html:
<!DOCTYPE HTML>
<html>
<head>
<script>
function test1() {
var t = document.getElementById('showtextout');
t.selectionStart = 0;
t.selectionEnd = t.value.length;
}
function test2() {
// this not work in popup!!
document.execCommand("copy");
}
</script>
</head>
<body>
<div id='divout'>
<textarea id="showtextout" rows="25"
cols="50">qwertyuiop1234567890</textarea>
<p align="center">
<input type="button" value="Select All" onClick='test1();' />
<input type="button" value="Copy" onClick='test2();' />
</p>
</div>
</body>
</html>
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to
chromium-...@chromium.org.
To unsubscribe from this group, send email to
chromium-extens...@chromium.org.
For more options, visit this group at
http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.