diff --git a/app/browser/webtorrent.js b/app/browser/webtorrent.js index bdf7cde26db..c3200142055 100644 --- a/app/browser/webtorrent.js +++ b/app/browser/webtorrent.js @@ -1,7 +1,6 @@ const electron = require('electron') const ipc = electron.ipcMain const messages = require('../../js/constants/messages') -const WebTorrentRemoteServer = require('webtorrent-remote/server') module.exports = {init} @@ -17,8 +16,11 @@ let channels = {} // Receive messages via the window process, ultimately from the UI in a process function init () { if (DEBUG_IPC) console.log('WebTorrent IPC init') - server = new WebTorrentRemoteServer(send, {trace: DEBUG_IPC}) ipc.on(messages.TORRENT_MESSAGE, function (e, msg) { + if (server === null) { + const WebTorrentRemoteServer = require('webtorrent-remote/server') + server = new WebTorrentRemoteServer(send, {trace: DEBUG_IPC}) + } if (DEBUG_IPC) console.log('Received IPC: ' + JSON.stringify(msg)) channels[msg.clientKey] = e.sender server.receive(msg) diff --git a/tools/lib/ignoredPaths.js b/tools/lib/ignoredPaths.js index 0626d3b4bdd..14707d2fc92 100644 --- a/tools/lib/ignoredPaths.js +++ b/tools/lib/ignoredPaths.js @@ -13,7 +13,6 @@ module.exports = [ 'cppunitlite', 'caniuse-db', 'spectron', - 'speedometer', 'abp-filter-parser-cpp/(node_modules|test|perf|sample|scripts|test|vendor|ABPFilterParserData.dat)', 'abp-filter-parser-cpp/build/Release/(obj|obj.target|.deps|abp-filter-parser-cpp.pdb|abp-filter-parser-cpp.map)', 'tracking-protection/(node_modules|test|data|scripts|vendor)', @@ -47,7 +46,6 @@ module.exports = [ 'electron-winstaller-fixed', 'electron-installer-redhat', 'flow-bin', - 'mkdirp', 'babel$', 'babel-(?!polyfill|regenerator-runtime)', 'jsdom-global',