Allow-scirpt in Print iframe


I am working on an Electron.js app which will open a JupyterLab inside. I want to disable print() function in this app so no one can save/print data out from this app. I tried to overwrite the window.print() function in all the iframes but it was proved impossible because of this: jupyterlab/printing.ts at 6c091561624110fe993f12fa0d9572c3ef418e26 · jupyterlab/jupyterlab · GitHub

Basically how Print works in JupyterLab is that it would create a hidden iframe with attr sandbox: 'allow-modals allow-same-origin', and this will prevent me from execute my script to overwrite the print() function.

Just want to know why don’t JupyterLab ‘allow-script’ for the iframe? For security reasons I suppose?