webapp: Workaround for copying console output to clipboard
Hint:: clipboard.writeText is only available when using https mode or access from localhost
This commit is contained in:
parent
b72a98d5cd
commit
729632dc23
@ -116,14 +116,12 @@ export default defineComponent({
|
|||||||
this.consoleBuffer = "";
|
this.consoleBuffer = "";
|
||||||
},
|
},
|
||||||
copyConsole() {
|
copyConsole() {
|
||||||
navigator.clipboard.writeText(this.consoleBuffer).then(
|
var input = document.createElement('textarea');
|
||||||
() => {
|
input.innerHTML = this.consoleBuffer;
|
||||||
console.log('clipboard successfully set');
|
document.body.appendChild(input);
|
||||||
},
|
input.select();
|
||||||
() => {
|
document.execCommand('copy');
|
||||||
console.error('clipboard write failed');
|
document.body.removeChild(input);
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user