Skip to content

Instantly share code, notes, and snippets.

@pushkin-
Created May 26, 2022 18:15
Show Gist options
  • Save pushkin-/847d0c25faca838884ef0c574032028d to your computer and use it in GitHub Desktop.
Save pushkin-/847d0c25faca838884ef0c574032028d to your computer and use it in GitHub Desktop.
print crash
<!-- Empty -->
const {app, BrowserWindow, dialog} = require('electron')
async function createWindow () {
const mainWindow = new BrowserWindow()
await mainWindow.loadURL('https://google.com')
mainWindow.webContents.print({}, (success) => {
dialog.showMessageBox(mainWindow, {
message: `success: ${success}`
});
});
}
app.whenReady().then(() => {
createWindow()
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment