Merge pull request #1858 from lbryio/electron-2.0.6

update electron to 2.0.6
This commit is contained in:
Sean Yesmunt 2018-08-08 17:32:13 -04:00 committed by GitHub
commit 10481a7173
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 5 deletions

View file

@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
* Pass error message from spee.ch API during thumbnail upload ([#1840](https://github.com/lbryio/lbry-desktop/pull/1840))
* Use router pattern for rendering file viewer ([#1544](https://github.com/lbryio/lbry-desktop/pull/1544))
* Missing word "to" added to the Bid Help Text (#1854)
* Updated to electron@2 ([#1858](https://github.com/lbryio/lbry-desktop/pull/1858))
### Fixed
* **Wallet -> Get Credits** page now shows correct ShapeShift status when it's avialable ([#1836](https://github.com/lbryio/lbry-desktop/issues/1836))

View file

@ -98,7 +98,7 @@
"decompress": "^4.2.0",
"del": "^3.0.0",
"devtron": "^1.4.0",
"electron": "^1.8.4",
"electron": "^2.0.6",
"electron-builder": "^20.22.0",
"electron-devtools-installer": "^2.2.3",
"electron-webpack": "^1.13.0",

View file

@ -5,7 +5,7 @@ import SemVer from 'semver';
import findProcess from 'find-process';
import url from 'url';
import https from 'https';
import { shell, app, ipcMain, dialog } from 'electron';
import { shell, app, ipcMain, dialog, session } from 'electron';
import { autoUpdater } from 'electron-updater';
import isDev from 'electron-is-dev';
import Daemon from './Daemon';
@ -58,6 +58,9 @@ if (isDev) {
app.commandLine.appendSwitch('ignore-gpu-blacklist');
app.commandLine.appendSwitch('--disable-gpu-process-crash-limit');
app.disableDomainBlockingFor3DAPIs();
// Disable security warnings in dev mode - https://github.com/electron/electron/blob/master/docs/tutorial/security.md#electron-security-warnings
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = true;
}
app.on('ready', async () => {
@ -89,6 +92,15 @@ app.on('ready', async () => {
rendererWindow.webContents.send('devtools-is-opened');
});
tray = createTray(rendererWindow);
// HACK: patch webrequest to fix devtools incompatibility with electron 2.x.
// See https://github.com/electron/electron/issues/13008#issuecomment-400261941
session.defaultSession.webRequest.onBeforeRequest({}, (details, callback) => {
if (details.url.indexOf('7accc8730b0f99b5e7c0702ea89d1fa7c17bfe33') !== -1) {
callback({redirectURL: details.url.replace('7accc8730b0f99b5e7c0702ea89d1fa7c17bfe33', '57c9d07b416b5a2ea23d28247300e4af36329bdc')});
} else {
callback({cancel: false});
}
});
});
app.on('activate', () => {

View file

@ -3173,9 +3173,9 @@ electron-window-state@^4.1.1:
jsonfile "^2.2.3"
mkdirp "^0.5.1"
electron@^1.8.4:
version "1.8.7"
resolved "https://registry.yarnpkg.com/electron/-/electron-1.8.7.tgz#373c1dc4589d7ab4acd49aff8db4a1c0a6c3bcc1"
electron@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/electron/-/electron-2.0.6.tgz#8e5c1bd2ebc08fa7a6ee906de3753c1ece9d7300"
dependencies:
"@types/node" "^8.0.24"
electron-download "^3.0.1"