Electron webview silent print


I need to find a solution to make ANY print from webview silent using window.print()

in Electron html file, I used :

const webview = document.querySelector('webview')
webview.print({silent: true})

but the dialog printing box still popup, anyone can help me to find out what is my mistake in above code.