window-on-print
v0.2.2
Published
Reliably detect when the user prints.
Downloads
272
Maintainers
Readme
window-on-print
Reliably detect when the user prints. A better solution for beforeprint
/afterprint
.
Installing
npm install window-on-print
Usage
const onPrint = require('window-on-print')
const unsubscribe = onPrint.before(window, () => {
console.info('user is going to print')
})
onPrint.after(window, () => {
console.info('user is has printed or aborted')
})
You may call unsubscribe()
to stop listening for events.
Contributing
If you have a question, found a bug or want to propose a feature, have a look at the issues page.