mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
non-https clipboard newlines; fixes #161
This commit is contained in:
parent
4fb87ebe32
commit
94352f278b
|
@ -1229,7 +1229,7 @@ function dl_file(url) {
|
||||||
function cliptxt(txt, ok) {
|
function cliptxt(txt, ok) {
|
||||||
var fb = function () {
|
var fb = function () {
|
||||||
console.log('clip-fb');
|
console.log('clip-fb');
|
||||||
var o = mknod('input');
|
var o = mknod('textarea');
|
||||||
o.value = txt;
|
o.value = txt;
|
||||||
document.body.appendChild(o);
|
document.body.appendChild(o);
|
||||||
o.focus();
|
o.focus();
|
||||||
|
@ -1239,6 +1239,8 @@ function cliptxt(txt, ok) {
|
||||||
ok();
|
ok();
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
|
if (!window.isSecureContext)
|
||||||
|
throw 1;
|
||||||
navigator.clipboard.writeText(txt).then(ok, fb);
|
navigator.clipboard.writeText(txt).then(ok, fb);
|
||||||
}
|
}
|
||||||
catch (ex) { fb(); }
|
catch (ex) { fb(); }
|
||||||
|
|
Loading…
Reference in a new issue