diff --git a/config.js b/config.js index 158ccb3f..a5edb5c4 100644 --- a/config.js +++ b/config.js @@ -17,6 +17,8 @@ module.exports = { AUTO_UPDATE_URL: 'https://webtorrent.io/desktop/update?version=' + APP_VERSION, AUTO_UPDATE_CHECK_STARTUP_DELAY: 5 * 1000 /* 5 seconds */, + CRASH_REPORT_URL: 'https://webtorrent.io/desktop/crash-report', + CONFIG_PATH: applicationConfigPath(APP_NAME), CONFIG_POSTER_PATH: path.join(applicationConfigPath(APP_NAME), 'Posters'), CONFIG_TORRENT_PATH: path.join(applicationConfigPath(APP_NAME), 'Torrents'), diff --git a/main/handlers.js b/main/handlers.js index 50b9a082..b174609f 100644 --- a/main/handlers.js +++ b/main/handlers.js @@ -30,14 +30,16 @@ function uninstall () { } function installDarwin () { - var electron = require('electron') - var app = electron.app + // TODO: Uncomment this once we upgrade past Electron 0.37.4. - // On OS X, only protocols that are listed in Info.plist can be set as the default - // handler at runtime. - app.setAsDefaultProtocolClient('magnet') + // var electron = require('electron') + // var app = electron.app - // File handlers are registered in the Info.plist. + // // On OS X, only protocols that are listed in Info.plist can be set as the default + // // handler at runtime. + // app.setAsDefaultProtocolClient('magnet') + + // // File handlers are registered in the Info.plist. } function uninstallDarwin () {} diff --git a/main/index.js b/main/index.js index bbc81a1b..82374204 100644 --- a/main/index.js +++ b/main/index.js @@ -1,6 +1,7 @@ var electron = require('electron') var app = electron.app +var crashReporter = electron.crashReporter var ipcMain = electron.ipcMain var autoUpdater = require('./auto-updater') @@ -130,10 +131,9 @@ function processArgv (argv) { } function setupCrashReporter () { - // require('crash-reporter').start({ - // productName: 'WebTorrent', - // companyName: 'WebTorrent', - // submitURL: 'https://webtorrent.io/crash-report', - // autoSubmit: true - // }) + crashReporter.start({ + companyName: config.APP_NAME, + productName: config.APP_NAME, + submitURL: config.CRASH_REPORT_URL + }) } diff --git a/main/squirrel-win32.js b/main/squirrel-win32.js index 7ae1c781..6c5b7bbc 100644 --- a/main/squirrel-win32.js +++ b/main/squirrel-win32.js @@ -40,13 +40,18 @@ function handleEvent (cmd) { if (cmd === '--squirrel-uninstall') { // App was just uninstalled. Undo anything we did in the --squirrel-install and // --squirrel-updated handlers - removeShortcuts(function () { - app.quit() - }) // Uninstall .torrent file and magnet link handlers handlers.uninstall() + // Remove desktop/start menu shortcuts. + // HACK: add a callback to handlers.uninstall() so we can remove this setTimeout + setTimeout(function () { + removeShortcuts(function () { + app.quit() + }) + }, 1000) + return true } diff --git a/package.json b/package.json index 857ca4e7..6c37fad6 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "create-torrent": "^3.22.1", "drag-drop": "^2.11.0", "electron-localshortcut": "^0.6.0", - "electron-prebuilt": "0.37.4", + "electron-prebuilt": "0.37.3", "hyperx": "^2.0.2", "main-loop": "^3.2.0", "mkdirp": "^0.5.1", diff --git a/renderer/index.js b/renderer/index.js index 4fbedb30..b22ee1d6 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -35,7 +35,9 @@ var Cast = null // a renderer process (essentially a Chrome window). We're in the renderer process, // and this IPC channel receives from and sends messages to the main process var ipcRenderer = electron.ipcRenderer + var clipboard = electron.clipboard +var crashReporter = electron.crashReporter var dialog = remote.require('dialog') // For easy debugging in Developer Tools @@ -58,6 +60,9 @@ loadState(init) * the dock icon and drag+drop. */ function init () { + setupCrashReporter() + + // Push the first page into the location history state.location.go({ url: 'home' }) // Lazily load the WebTorrent, Chromecast, and Airplay modules @@ -1057,3 +1062,11 @@ function playInterfaceSound (name) { audio.src = sound.url audio.play() } + +function setupCrashReporter () { + crashReporter.start({ + companyName: config.APP_NAME, + productName: config.APP_NAME, + submitURL: config.CRASH_REPORT_URL + }) +}