The viewer emits messages triggered by user actions, allowing you to customise the experience
that your site provides in response.
Security
First a little note about security.
Improperly implemented message listeners could open your site up to cross-site
scripting (XSS) attacks.
To mitigate risk, you should check the origin of the incoming message and ensure that you properly
santize any data that you may pass to your server as a result of the message.
See here
for more information.
Messages
Message | Description |
---|---|
scpDialogPrintShow |
Print dialog was displayed |
scpDialogPrintApprove |
User launched browser print dialog |
scpDialogPrintDeny |
User cancelled printing |
scpOnBeforePrint |
Triggered before the browser displays its print dialog |
scpOnAfterPrint |
Triggered after the browser print dialog has been closed |
Examples
Listening for messages
1 | const Messages = { |