Skip to content

Commit

Permalink
fix(show-me/crashreporter): refactor to use current Electron security…
Browse files Browse the repository at this point in the history
… defaults (electron#899)

Co-authored-by: Timothy Lim <[email protected]>
  • Loading branch information
thewheat and Timothy Lim committed Nov 16, 2021
1 parent 831b978 commit 88d3471
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
3 changes: 0 additions & 3 deletions static/show-me/crashreporter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@
</head>
<body>
<h1>CrashReporter Demo</h1>
<script>
require('./renderer.js')
</script>
</body>
</html>
14 changes: 12 additions & 2 deletions static/show-me/crashreporter/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@
// For more info, see:
// https://electronjs.org/docs/api/crash-reporter

const { app, BrowserWindow } = require('electron')
const { app, BrowserWindow, crashReporter } = require('electron')
const path = require('path')

crashReporter.start({
productName: 'YourName',
companyName: 'YourCompany',
submitURL: 'https://your-domain.com/url-to-submit',
uploadToServer: true
})

app.whenReady().then(() => {
const mainWindow = new BrowserWindow({
height: 600,
width: 600,
webPreferences: {
nodeIntegration: true
nodeIntegration: false, // default in Electron >= 5
contextIsolation: true, // default in Electron >= 12
preload: path.join(__dirname, 'preload.js')
}
})
mainWindow.loadFile('index.html')
Expand Down
3 changes: 3 additions & 0 deletions static/show-me/crashreporter/preload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setTimeout(() => {
process.crash()
}, 2000)
12 changes: 0 additions & 12 deletions static/show-me/crashreporter/renderer.js

This file was deleted.

0 comments on commit 88d3471

Please sign in to comment.