1
0
mirror of https://github.com/rhysd/Mstdn.git synced 2025-01-21 20:52:11 +01:00

open external page with external browser again (fix #14)

I confirmed the bug was fixed with Windows 8.1
This commit is contained in:
rhysd 2017-05-02 11:50:03 +09:00
parent 84b740839b
commit 8f60edd353
3 changed files with 2 additions and 11 deletions

View File

@ -4,7 +4,6 @@ import {app} from 'electron';
export const IS_DEBUG = process.env.NODE_ENV === 'development';
export const IS_DARWIN = process.platform === 'darwin';
export const IS_WINDOWS = process.platform === 'win32';
export const IS_LINUX = process.platform === 'linux';
export const APP_ICON = path.join(__dirname, '..', 'resources', 'icon', 'icon.png');
export const PRELOAD_JS = path.join(__dirname, '..', 'renderer', 'preload.js');
export const DATA_DIR = app.getPath('userData');

View File

@ -5,9 +5,7 @@ import * as menubar from 'menubar';
import {Config, Account, hostUrl} from './config';
import {partitionForAccount} from './account_switcher';
import log from './log';
import {IS_DEBUG, IS_DARWIN, IS_WINDOWS, IS_LINUX, APP_ICON, PRELOAD_JS, USER_CSS, IOS_SAFARI_USERAGENT, trayIcon} from './common';
const ELECTRON_ISSUE_9230 = IS_WINDOWS || IS_LINUX;
import {IS_DEBUG, IS_DARWIN, IS_WINDOWS, APP_ICON, PRELOAD_JS, USER_CSS, IOS_SAFARI_USERAGENT, trayIcon} from './common';
function shouldOpenInternal(host: string, url: string): boolean {
if (host.startsWith('https://pawoo.net') && url.startsWith('https://accounts.pixiv.net/login?')) {
@ -58,12 +56,6 @@ export default class Window {
log.debug('Opened URL with external browser (will-navigate)', url);
});
browser.webContents.on('new-window', (e, url) => {
if (ELECTRON_ISSUE_9230) {
// XXX:
// On Windows or Linux, rel="noopener" lets app crash on preventing the event.
// Issue: https://github.com/electron/electron/issues/9230
return;
}
e.preventDefault();
shell.openExternal(url);
log.debug('Opened URL with external browser (new-window)', url);

View File

@ -50,7 +50,7 @@
"typescript": "^2.2.2"
},
"dependencies": {
"electron": "^1.6.5",
"electron": "^1.6.8-beta",
"electron-window-state": "^4.1.1",
"loglevel": "^1.4.1",
"menubar": "github:rhysd/menubar#mstdn",