[SecurityUtils] Remove as unneeded

main
Oj 2 years ago
parent 5a3cf6d81f
commit 0abad98295

3
src/bootstrap.js vendored

@ -65,9 +65,6 @@ const startCore = () => {
GPUSettings,
updater,
crashReporterSetup,
// OpenCore additionals (non-standard)
securityUtils: require('./utils/securityUtils.js')
});
const i = setImmediate(() => {

@ -24,8 +24,6 @@ var moduleUpdater = _interopRequireWildcard(require("../updater/moduleUpdater"))
var paths = _interopRequireWildcard(require("../paths"));
var _securityUtils = require("../utils/securityUtils");
var _updater = require("../updater/updater");
const ipcMain = _electron.ipcMain;
@ -389,15 +387,6 @@ function launchSplashWindow(startMinimized) {
splashWindow = new _electron.BrowserWindow(windowConfig); // prevent users from dropping links to navigate in splash window
log('Splash', 'Created BrowserWindow');
splashWindow.webContents.on('will-navigate', e => e.preventDefault());
splashWindow.webContents.on('new-window', (e, windowURL) => {
e.preventDefault();
(0, _securityUtils.saferShellOpenExternal)(windowURL); // exit, but delay half a second because openExternal is about to fire
// some events to things that are freed by app.quit.
setTimeout(_electron.app.quit, 500);
});
if (process.platform !== 'darwin') {
// citron note: this causes a crash on quit while the window is open on osx
splashWindow.on('closed', () => {

@ -1,7 +0,0 @@
const { shell } = require('electron');
const allowedProtocols = [ 'https', 'http' ]; // Only allow some protocols
exports.saferShellOpenExternal = (url) => allowedProtocols.includes(url.split(':')[0].toLowerCase()) ? shell.openExternal(url) : Promise.reject();
const oParse = (u) => u.split('/').slice(0, 3).join('/');
exports.checkUrlOriginMatches = (a, b) => oParse(a) === oParse(b);
Loading…
Cancel
Save