The MeadCo ScriptX.Services Client Library emulation of the “factory” object includes a “keydown” event listener that handles the use of ctrl-p to start a print using ScriptX.Services rather than with the browser UI. Along with overriding window.print() and any on-page UI this helps ensure the user always has printed output as described by the developer.
This is fine, and useful except that developers could not change this behaviour to, for example, completely disable printing using ctrl-p.
Version 1.7.2 of MeadCo ScriptX.Services Client Library allows developers to disable this behaviour in one of two ways:
- Add the atrtibute/value
data-meadco-ctrlp="false"
to any element that is parsed before the ScriptX.Services Client Library modules run. For example, add to the script element that is already carrying atributes such as data-meadco-server. This attribute/value prevents the event listener being added. -
In on page script remove the event listener with the script
document.removeEventListener("keydown", factory.keyPressCtrlP);
In either case, any other desired behaviour can then be implemented.