Is it possible with chrome extension to read ctrl+p data and save it as pdf or html without showing print screen?
To read what is on the clipboard this works.
async function getClipboardContents() {
try {
const text = await navigator.clipboard.readText();
console.log('Pasted content: ', text);
} catch (err) {
console.error('Failed to read clipboard contents: ', err);
}
}
To prevent CTRL+P put this into your head tag
<link rel="alternate" media="print" href="alternativeUrlForPrint.ext" />
Use the L2i Library to capture what is in your console, it will capture anything you put there using the above code. Then you just download it with a function.
l2i.download();
Lastly you can put this all into TamperMonkey to make it an extension.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With