77 lines
8.3 KiB
JavaScript
77 lines
8.3 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const path_1 = __importDefault(require("path"));
|
|
const binaries_1 = __importDefault(require("./binaries"));
|
|
const chromiumCmdArgs = [
|
|
'--disable-infobars',
|
|
'--disable-session-crashed-bubble',
|
|
'--no-first-run',
|
|
'--new-window',
|
|
'--disable-background-networking',
|
|
'--disable-ipc-flooding-protection',
|
|
'--disable-background-timer-throttling',
|
|
'--disable-backgrounding-occluded-windows',
|
|
'--autoplay-policy=no-user-gesture-required'
|
|
].join(' ');
|
|
const edgeCmdArgs = [
|
|
'--new-window',
|
|
'--disable-background-timer-throttling',
|
|
'--disable-backgrounding-occluded-windows'
|
|
].join(' ');
|
|
const ALIASES = {
|
|
'ie': {
|
|
nameRe: /iexplore|internet explorer/i,
|
|
cmd: ''
|
|
},
|
|
'firefox': {
|
|
nameRe: /firefox|mozilla/i,
|
|
cmd: `-override "${path_1.default.join(__dirname, '../data/override.ini')}" -new-window`,
|
|
macOpenCmdTemplate: 'open -a "{{{path}}}" {{{pageUrl}}} --args {{{cmd}}}',
|
|
linuxBinaries: ['firefox']
|
|
},
|
|
'chrome-canary': {
|
|
nameRe: /chrome\s*canary/i,
|
|
cmd: chromiumCmdArgs,
|
|
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
|
|
linuxBinaries: ['google-chrome-canary']
|
|
},
|
|
'chrome': {
|
|
nameRe: /chrome/i,
|
|
cmd: chromiumCmdArgs,
|
|
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
|
|
linuxBinaries: ['google-chrome', 'google-chrome-stable', 'google-chrome-unstable']
|
|
},
|
|
'chromium': {
|
|
nameRe: /chromium/i,
|
|
cmd: chromiumCmdArgs,
|
|
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
|
|
linuxBinaries: ['chromium-browser', 'chromium']
|
|
},
|
|
'opera': {
|
|
nameRe: /opera/i,
|
|
cmd: '--new-window',
|
|
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
|
|
linuxBinaries: ['opera']
|
|
},
|
|
'safari': {
|
|
nameRe: /safari/i,
|
|
cmd: '',
|
|
path: binaries_1.default.app,
|
|
macOpenCmdTemplate: `open -n -a "{{{path}}}" --args "${binaries_1.default.main}" /dev/null open {{{pageUrl}}} {{{cmd}}}`
|
|
},
|
|
'edge': {
|
|
nameRe: /edge/i,
|
|
cmd: edgeCmdArgs,
|
|
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
|
|
linuxBinaries: ['microsoft-edge']
|
|
},
|
|
'edge-legacy': {
|
|
cmd: '',
|
|
winOpenCmdTemplate: 'start microsoft-edge:"{{{pageUrl}}}"'
|
|
}
|
|
};
|
|
exports.default = ALIASES;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxpYXNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9hbGlhc2VzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsZ0RBQXdCO0FBQ3hCLDBEQUFrQztBQUVsQyxNQUFNLGVBQWUsR0FBRztJQUNwQixvQkFBb0I7SUFDcEIsa0NBQWtDO0lBQ2xDLGdCQUFnQjtJQUNoQixjQUFjO0lBQ2QsaUNBQWlDO0lBQ2pDLG1DQUFtQztJQUNuQyx1Q0FBdUM7SUFDdkMsMENBQTBDO0lBQzFDLDRDQUE0QztDQUMvQyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUVaLE1BQU0sV0FBVyxHQUFHO0l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hcmdzIHt7e3BhZ2VVcmx9fX0ge3t7Y21kfX19JyxcbiAgICAgICAgbGludXhCaW5hcmllczogICAgICBbJ2dvb2dsZS1jaHJvbWUtY2FuYXJ5J11cbiAgICB9LFxuXG4gICAgJ2Nocm9tZSc6IHtcbiAgICAgICAgbmFtZVJlOiAgICAgICAgICAgICAvY2hyb21lL2ksXG4gICAgICAgIGNtZDogICAgICAgICAgICAgICAgY2hyb21pdW1DbWRBcmdzLFxuICAgICAgICBtYWNPcGVuQ21kVGVtcGxhdGU6ICdvcGVuIC1uIC1hIFwie3t7cGF0aH19fVwiIC0tYXJncyB7e3twYWdlVXJsfX19IHt7e2NtZH19fScsXG4gICAgICAgIGxpbnV4QmluYXJpZXM6ICAgICAgWydnb29nbGUtY2hyb21lJywgJ2dvb2dsZS1jaHJvbWUtc3RhYmxlJywgJ2dvb2dsZS1jaHJvbWUtdW5zdGFibGUnXVxuICAgIH0sXG5cbiAgICAnY2hyb21pdW0nOiB7XG4gICAgICAgIG5hbWVSZTogICAgICAgICAgICAgL2Nocm9taXVtL2ksXG4gICAgICAgIGNtZDogICAgICAgICAgICAgICAgY2hyb21pdW1DbWRBcmdzLFxuICAgICAgICBtYWNPcGVuQ21kVGVtcGxhdGU6ICdvcGVuIC1uIC1hIFwie3t7cGF0aH19fVwiIC0tYXJncyB7e3twYWdlVXJsfX19IHt7e2NtZH19fScsXG4gICAgICAgIGxpbnV4QmluYXJpZXM6ICAgICAgWydjaHJvbWl1bS1icm93c2VyJywgJ2Nocm9taXVtJ11cbiAgICB9LFxuXG4gICAgJ29wZXJhJzoge1xuICAgICAgICBuYW1lUmU6ICAgICAgICAgICAgIC9vcGVyYS9pLFxuICAgICAgICBjbWQ6ICAgICAgICAgICAgICAgICctLW5ldy13aW5kb3cnLFxuICAgICAgICBtYWNPcGVuQ21kVGVtcGxhdGU6ICdvcGVuIC1uIC1hIFwie3t7cGF0aH19fVwiIC0tYXJncyB7e3twYWdlVXJsfX19IHt7e2NtZH19fScsXG4gICAgICAgIGxpbnV4QmluYXJpZXM6ICAgICAgWydvcGVyYSddXG4gICAgfSxcblxuICAgICdzYWZhcmknOiB7XG4gICAgICAgIG5hbWVSZTogICAgICAgICAgICAgL3NhZmFyaS9pLFxuICAgICAgICBjbWQ6ICAgICAgICAgICAgICAgICcnLFxuICAgICAgICBwYXRoOiAgICAgICAgICAgICAgIEJJTkFSSUVTLmFwcCxcbiAgICAgICAgbWFjT3BlbkNtZFRlbXBsYXRlOiBgb3BlbiAtbiAtYSBcInt7e3BhdGh9fX1cIiAtLWFyZ3MgXCIke0JJTkFSSUVTLm1haW59XCIgL2Rldi9udWxsIG9wZW4ge3t7cGFnZVVybH19fSB7e3tjbWR9fX1gXG4gICAgfSxcblxuICAgICdlZGdlJzoge1xuICAgICAgICBuYW1lUmU6ICAgICAgICAgICAgIC9lZGdlL2ksXG4gICAgICAgIGNtZDogICAgICAgICAgICAgICAgZWRnZUNtZEFyZ3MsXG4gICAgICAgIG1hY09wZW5DbWRUZW1wbGF0ZTogJ29wZW4gLW4gLWEgXCJ7e3twYXRofX19XCIgLS1hcmdzIHt7e3BhZ2VVcmx9fX0ge3t7Y21kfX19JyxcbiAgICAgICAgbGludXhCaW5hcmllczogICAgICBbJ21pY3Jvc29mdC1lZGdlJ11cbiAgICB9LFxuXG4gICAgJ2VkZ2UtbGVnYWN5Jzoge1xuICAgICAgICBjbWQ6ICAgICAgICAgICAgICAgICcnLFxuICAgICAgICB3aW5PcGVuQ21kVGVtcGxhdGU6ICdzdGFydCBtaWNyb3NvZnQtZWRnZTpcInt7e3BhZ2VVcmx9fX1cIidcbiAgICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBTElBU0VTO1xuIl19
|