js.executescript for copied text code example
Example 1: js get copied text
navigator.clipboard.readText().then(clipText =>
document.getElementById("outbox").innerText = clipText);
Example 2: js get copied text
navigator.permissions.query({name: "clipboard-write"}).then(result => {
if (result.state == "granted" || result.state == "prompt") {
/* write to the clipboard now */
}
});