mirror of
https://github.com/Lightcord/Lightcord.git
synced 2025-04-12 00:55:40 +02:00

tabs fix (I fixed network, open tab and other things) travis prerelease Getting rid of the remote module (partially). Still have a lot of work. Updating native modules. partially updating to match version 0.0.308. Still need more changes.
31 lines
790 B
JavaScript
31 lines
790 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.saferShellOpenExternal = saferShellOpenExternal;
|
|
|
|
var _electron = require("electron");
|
|
|
|
var _url = _interopRequireDefault(require("url"));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
var BLOCKED_URL_PROTOCOLS = ['file:', 'javascript:', 'vbscript:', 'data:', 'about:', 'chrome:', 'ms-cxh:', 'ms-cxh-full:', 'ms-word:'];
|
|
|
|
function saferShellOpenExternal(externalUrl) {
|
|
var parsedUrl;
|
|
|
|
try {
|
|
parsedUrl = _url["default"].parse(externalUrl);
|
|
} catch (_) {
|
|
return;
|
|
}
|
|
|
|
if (parsedUrl.protocol == null || BLOCKED_URL_PROTOCOLS.includes(parsedUrl.protocol.toLowerCase())) {
|
|
return;
|
|
}
|
|
|
|
_electron.shell.openExternal(externalUrl);
|
|
}
|