Skip to content

Commit

Permalink
Merge pull request #1834 from webtorrent/electron10
Browse files Browse the repository at this point in the history
  • Loading branch information
feross authored Jul 16, 2020
2 parents ed3f3f1 + 48ad571 commit 5af3642
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 54 deletions.
72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"buble": "^0.20.0",
"cross-zip": "^3.1.0",
"depcheck": "^1.0.0",
"electron": "~9.1.0",
"electron": "~10.0.0-beta.11",
"electron-osx-sign": "^0.4.17",
"electron-packager": "^15.0.0",
"electron-winstaller": "^4.0.1",
Expand Down
5 changes: 3 additions & 2 deletions src/crash-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ function init () {
const electron = require('electron')

electron.crashReporter.start({
companyName: config.APP_NAME,
productName: config.APP_NAME,
submitURL: config.CRASH_REPORT_URL
submitURL: config.CRASH_REPORT_URL,
globalExtra: { _companyName: config.APP_NAME },
compress: true
})
}
9 changes: 4 additions & 5 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ console.time('init')
const electron = require('electron')
const app = electron.app

// Start crash reporter early, so it takes effect for child processes
const crashReporter = require('../crash-reporter')
crashReporter.init()

const parallel = require('run-parallel')

const config = require('../config')
const crashReporter = require('../crash-reporter')
const ipc = require('./ipc')
const log = require('./log')
const menu = require('./menu')
Expand Down Expand Up @@ -109,10 +112,6 @@ function init () {

ipc.init()

app.once('will-finish-launching', function () {
crashReporter.init()
})

app.once('ipcReady', function () {
log('Command line args:', argv)
processArgv(argv)
Expand Down
3 changes: 2 additions & 1 deletion src/main/windows/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ function init () {
useContentSize: true,
webPreferences: {
nodeIntegration: true,
enableBlinkFeatures: 'AudioVideoTracks'
enableBlinkFeatures: 'AudioVideoTracks',
enableRemoteModule: true
},
width: 300
})
Expand Down
3 changes: 2 additions & 1 deletion src/main/windows/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function init (state, options) {
width: initialBounds.width,
webPreferences: {
nodeIntegration: true,
enableBlinkFeatures: 'AudioVideoTracks'
enableBlinkFeatures: 'AudioVideoTracks',
enableRemoteModule: true
},
x: initialBounds.x,
y: initialBounds.y
Expand Down
3 changes: 2 additions & 1 deletion src/main/windows/webtorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ function init () {
useContentSize: true,
webPreferences: {
nodeIntegration: true,
enableBlinkFeatures: 'AudioVideoTracks'
enableBlinkFeatures: 'AudioVideoTracks',
enableRemoteModule: true
},
width: 150
})
Expand Down
3 changes: 0 additions & 3 deletions src/renderer/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ Module.prototype.require = function (id) {

console.time('init')

const crashReporter = require('../crash-reporter')
crashReporter.init()

// Perf optimization: Start asynchronously read on config file before all the
// blocking require() calls below.

Expand Down
4 changes: 0 additions & 4 deletions src/renderer/webtorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ const networkAddress = require('network-address')
const path = require('path')
const WebTorrent = require('webtorrent')

const crashReporter = require('../crash-reporter')
const config = require('../config')
const { TorrentKeyNotFoundError } = require('./lib/errors')
const torrentPoster = require('./lib/torrent-poster')

// Report when the process crashes
crashReporter.init()

// Send & receive messages from the main window
const ipc = electron.ipcRenderer

Expand Down

0 comments on commit 5af3642

Please sign in to comment.