mirror of https://github.com/jiahaog/Nativefier
Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
This commit is contained in:
parent
9286fc8086
commit
41b208fcb7
|
@ -29,6 +29,21 @@ if (require('electron-squirrel-startup')) {
|
||||||
|
|
||||||
const appArgs = JSON.parse(fs.readFileSync(APP_ARGS_FILE_PATH, 'utf8'));
|
const appArgs = JSON.parse(fs.readFileSync(APP_ARGS_FILE_PATH, 'utf8'));
|
||||||
|
|
||||||
|
// Take in a URL on the command line as an override
|
||||||
|
if (process.argv.length > 1) {
|
||||||
|
const maybeUrl = process.argv[1];
|
||||||
|
try {
|
||||||
|
new URL(maybeUrl);
|
||||||
|
appArgs.targetUrl = maybeUrl;
|
||||||
|
console.info('Loading override URL passed as argument:', maybeUrl);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(
|
||||||
|
'Not loading override URL passed as argument, because failed to parse:',
|
||||||
|
maybeUrl,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Nativefier is a browser, and an old browser is an insecure / badly-performant one.
|
// Nativefier is a browser, and an old browser is an insecure / badly-performant one.
|
||||||
// Given our builder/app design, we currently don't have an easy way to offer
|
// Given our builder/app design, we currently don't have an easy way to offer
|
||||||
// upgrades from the app themselves (like browsers do).
|
// upgrades from the app themselves (like browsers do).
|
||||||
|
|
Loading…
Reference in New Issue