mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-23 06:02:30 -05:00
attempt to open _blank link targets in OS's default browser, not electron
This commit is contained in:
parent
a866327656
commit
9c7aceea70
1 changed files with 7 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
import {ipcRenderer} from 'electron';
|
||||
import {ipcRenderer, shell} from 'electron';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import GUI, {AppStateHOC} from 'scratch-gui';
|
||||
|
@ -9,6 +9,12 @@ import styles from './app.css';
|
|||
|
||||
const defaultProjectId = 0;
|
||||
|
||||
// override window.open so that it uses the OS's default browser, not an electron browser
|
||||
window.open = function (url, target) {
|
||||
if (target === '_blank') {
|
||||
shell.openExternal(url);
|
||||
}
|
||||
};
|
||||
// Register "base" page view
|
||||
// analytics.pageview('/');
|
||||
|
||||
|
|
Loading…
Reference in a new issue