remove electron-debug

This commit is contained in:
Feross Aboukhadijeh
2016-03-02 14:20:56 -08:00
parent 0d0bd22ca5
commit fd7c819a4e
2 changed files with 22 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
var startTime = Date.now()
require('debug/browser') require('debug/browser')
var debug = require('debug')('index') var debug = require('debug')('index')
@@ -22,9 +24,6 @@ function onOpen (e, torrentId) {
// autoSubmit: true // autoSubmit: true
// }) // })
// adds debug features like hotkeys for triggering dev tools and reload
require('electron-debug')()
// prevent windows from being garbage collected // prevent windows from being garbage collected
var mainWindow // eslint-disable-line no-unused-vars var mainWindow // eslint-disable-line no-unused-vars
@@ -65,8 +64,9 @@ function createMainWindow () {
win.loadURL('file://' + path.join(__dirname, 'main', 'index.html')) win.loadURL('file://' + path.join(__dirname, 'main', 'index.html'))
win.webContents.on('did-finish-load', function () { win.webContents.on('did-finish-load', function () {
setTimeout(function () { setTimeout(function () {
debug('startup time: %sms', Date.now() - startTime)
win.show() win.show()
}, 30) }, 50)
}) })
win.on('close', function (e) { win.on('close', function (e) {
if (process.platform === 'darwin' && !isQuitting) { if (process.platform === 'darwin' && !isQuitting) {
@@ -188,7 +188,7 @@ var template = [
else return 'Ctrl+Shift+I' else return 'Ctrl+Shift+I'
})(), })(),
click: function (item, focusedWindow) { click: function (item, focusedWindow) {
if (focusedWindow) focusedWindow.toggleDevTools() devTools(focusedWindow)
} }
} }
] ]
@@ -284,6 +284,23 @@ if (process.platform === 'darwin') {
) )
} }
function devTools (win) {
win = win || electron.BrowserWindow.getFocusedWindow()
if (win) {
win.toggleDevTools()
}
}
function reload (win) {
win = win || electron.BrowserWindow.getFocusedWindow()
if (win) {
startTime = Date.now()
win.webContents.reloadIgnoringCache()
}
}
// var progress = 0 // var progress = 0
// setInterval(function () { // setInterval(function () {
// progress += 0.1 // progress += 0.1

View File

@@ -16,7 +16,6 @@
"create-torrent": "^3.22.1", "create-torrent": "^3.22.1",
"debug": "^2.2.0", "debug": "^2.2.0",
"drag-drop": "^2.3.1", "drag-drop": "^2.3.1",
"electron-debug": "^0.5.0",
"network-address": "^1.1.0", "network-address": "^1.1.0",
"pretty-bytes": "^3.0.0", "pretty-bytes": "^3.0.0",
"throttleit": "^1.0.0", "throttleit": "^1.0.0",