79297161

Date: 2024-12-20 12:05:08
Score: 1
Natty:
Report link

You can intercept using event target and define a name to the document target like this:

trigger(document, fileName) {
    window.addEventListener('beforeprint', (event) => {
        if (!event) return;
        event.target.document.title = fileName;
    });
    window.print();
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: willianfrancas