Generate Link Generate Link Generate Link

Log file is not showing when I copy URL and paste it on another Tab

30 Views Asked by At

I am trying to share the current log file from the browser. Here I have 2 buttons which does the same.

  1. <button @click="addOpentabs">Generate Link</button> This button generates the url.
  2. <button @click.prevent="copyLayoutLink"">Copy layout link(Old way)</button> I am using this button to copy the current page url in the clipboard, and pasting this url to another tab. This url contains a log file.

enter image description here

The second button seems to be broken and not opening the current file. It also giving some path not finding error in the console.

//utils.js
export function copyToClipboard(text) {
    const dummy = document.createElement('textarea');
    document.body.appendChild(dummy);
    dummy.value = text;
    dummy.select();
    document.execCommand('copy');
    document.body.removeChild(dummy);
}

I doubt this execCommand('copy') has been deprecated and creating problem. Getting errors in console as below:- enter image description here

Any suggestion r help would be helpful regarding the same.

0

There are 0 best solutions below