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 = "";
|
||||
},
|
||||
copyConsole() {
|
||||
navigator.clipboard.writeText(this.consoleBuffer).then(
|
||||
() => {
|
||||
console.log('clipboard successfully set');
|
||||
},
|
||||
() => {
|
||||
console.error('clipboard write failed');
|
||||
}
|
||||
);
|
||||
var input = document.createElement('textarea');
|
||||
input.innerHTML = this.consoleBuffer;
|
||||
document.body.appendChild(input);
|
||||
input.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(input);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user