Browse Source
Merge pull request #491 from mrfelton/fix/devtools-electron-compatability
fix(devtools): patch webrequest to fix devtools
renovate/lint-staged-8.x
Ben Woosley
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
16 additions and
1 deletions
-
app/main.dev.js
|
|
@ -10,7 +10,7 @@ |
|
|
|
* |
|
|
|
* |
|
|
|
*/ |
|
|
|
import { app, BrowserWindow, ipcMain, dialog } from 'electron' |
|
|
|
import { app, BrowserWindow, ipcMain, dialog, session } from 'electron' |
|
|
|
import path from 'path' |
|
|
|
import fs from 'fs' |
|
|
|
import split2 from 'split2' |
|
|
@ -361,6 +361,21 @@ app.on('ready', async () => { |
|
|
|
mainWindow.webContents.send('successfullyCreatedWallet') |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 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('hack') !== -1) { |
|
|
|
callback({ |
|
|
|
redirectURL: details.url.replace( |
|
|
|
'7accc8730b0f99b5e7c0702ea89d1fa7c17bfe33', |
|
|
|
'57c9d07b416b5a2ea23d28247300e4af36329bdc' |
|
|
|
) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
callback({ cancel: false }) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
app.setAsDefaultProtocolClient('lightning') |
|
|
|