Browse Source
Don't open external links in the Electron context
patch-1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
17 deletions
-
react/src/components/dashboard/support/support.js
|
|
@ -1,5 +1,6 @@ |
|
|
|
import React from 'react'; |
|
|
|
import { translate } from '../../../translate/translate'; |
|
|
|
import electron from 'electron'; |
|
|
|
|
|
|
|
class Support extends React.Component { |
|
|
|
constructor() { |
|
|
@ -7,22 +8,7 @@ class Support extends React.Component { |
|
|
|
} |
|
|
|
|
|
|
|
openExternalWindow(url) { |
|
|
|
const remote = window.require('electron').remote; |
|
|
|
const BrowserWindow = remote.BrowserWindow; |
|
|
|
|
|
|
|
const externalWindow = new BrowserWindow({ |
|
|
|
width: 1280, |
|
|
|
height: 800, |
|
|
|
title: `${translate('INDEX.LOADING')}...`, |
|
|
|
icon: remote.getCurrentWindow().iguanaIcon, |
|
|
|
}); |
|
|
|
|
|
|
|
externalWindow.loadURL(url); |
|
|
|
externalWindow.webContents.on('did-finish-load', () => { |
|
|
|
setTimeout(() => { |
|
|
|
externalWindow.show(); |
|
|
|
}, 40); |
|
|
|
}); |
|
|
|
return electron.shell.openExternal(url); |
|
|
|
} |
|
|
|
|
|
|
|
render() { |
|
|
@ -94,4 +80,4 @@ class Support extends React.Component { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export default Support; |
|
|
|
export default Support; |
|
|
|