Merge pull request #316 from feross/f/prevent
Prevent killing the WebTorrent process
This commit is contained in:
@@ -67,7 +67,7 @@ function toggleDevTools () {
|
|||||||
|
|
||||||
function showWebTorrentWindow () {
|
function showWebTorrentWindow () {
|
||||||
windows.webtorrent.show()
|
windows.webtorrent.show()
|
||||||
windows.webtorrent.webContents.openDevTools({detach: true})
|
windows.webtorrent.webContents.openDevTools({ detach: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadWindow () {
|
function reloadWindow () {
|
||||||
@@ -262,6 +262,7 @@ function getAppMenuTemplate () {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Show WebTorrent Process',
|
label: 'Show WebTorrent Process',
|
||||||
|
accelerator: 'CmdOrCtrl+Alt+P',
|
||||||
click: showWebTorrentWindow
|
click: showWebTorrentWindow
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ function createWebTorrentHiddenWindow () {
|
|||||||
center: true,
|
center: true,
|
||||||
title: 'webtorrent-hidden-window',
|
title: 'webtorrent-hidden-window',
|
||||||
useContentSize: true,
|
useContentSize: true,
|
||||||
width: 368,
|
width: 150,
|
||||||
height: 388,
|
height: 150,
|
||||||
minimizable: false,
|
minimizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
@@ -65,8 +65,13 @@ function createWebTorrentHiddenWindow () {
|
|||||||
})
|
})
|
||||||
win.loadURL(config.WINDOW_WEBTORRENT)
|
win.loadURL(config.WINDOW_WEBTORRENT)
|
||||||
|
|
||||||
// To debug the WebTorrent process, set `show` to true above and uncomment:
|
// Prevent killing the WebTorrent process
|
||||||
// win.webContents.openDevTools({detached: false})
|
win.on('close', function (e) {
|
||||||
|
if (!electron.app.isQuitting) {
|
||||||
|
e.preventDefault()
|
||||||
|
win.hide()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMainWindow () {
|
function createMainWindow () {
|
||||||
|
|||||||
@@ -1,5 +1,22 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<body style="background-color: #282828; margin: 10px 0; overflow: hidden;">
|
<html lang="en">
|
||||||
<script async src="webtorrent.js"></script>
|
<head>
|
||||||
<img src="../static/WebTorrent.png">
|
<meta charset="utf-8">
|
||||||
</body>
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background-color: #282828;
|
||||||
|
margin: 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: 140px;
|
||||||
|
height: 140px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script async src="webtorrent.js"></script>
|
||||||
|
<img src="../static/WebTorrent.png">
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user