javascript:void(function(){
const copyListener = event => {
document.removeEventListener("copy", copyListener, true);
event.preventDefault();
let clipboardData = event.clipboardData;
clipboardData.clearData();
clipboardData.setData("text/plain", "<<TEXT TO COPY>>");
};
document.addEventListener("copy", copyListener, true);
document.execCommand("copy");
document.body.lastElementChild.setAttribute("hidden", "hidden");
document.preventDefault;
})()
Created
August 28, 2024 02:50
-
-
Save erhaem/9970053002534e3ceea1dec7a1328ae4 to your computer and use it in GitHub Desktop.
Copy text to clipboard using Bookmarklet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment