diff --git a/app/src/components/mainWindow/mainWindow.js b/app/src/components/mainWindow/mainWindow.js index 6ac236c..0c5c30f 100644 --- a/app/src/components/mainWindow/mainWindow.js +++ b/app/src/components/mainWindow/mainWindow.js @@ -52,6 +52,13 @@ function createMainWindow(options, onAppQuit, setDockBadge) { fs.writeFileSync(path.join(__dirname, '..', 'nativefier.json'), JSON.stringify(options)); } + // after first run, no longer force maximize to be true + if(options.maximize){ + mainWindow.maximize(); + options.maximize = undefined; + fs.writeFileSync(path.join(__dirname, '..', 'nativefier.json'), JSON.stringify(options)); + } + let currentZoom = 1; const onZoomIn = () => { diff --git a/docs/api.md b/docs/api.md index 88837ac..f286ed4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -25,6 +25,7 @@ - [[flash]](#flash) - [[inject]](#inject) - [[full-screen]](#full-screen) + - [[maximize]](#maximize) - [Programmatic API](#programmatic-api) ## Command Line @@ -226,6 +227,15 @@ $ nativefier http://google.com --inject ./some-js-injection.js --inject ./some-c Makes the packaged app start in full screen. + +#### [maximize] + +``` +--maximize +``` + +Makes the packaged app start maximized. + ## Programmatic API You can use the Nativefier programmatic API as well. diff --git a/src/build/buildApp.js b/src/build/buildApp.js index db9d2f9..afc7872 100644 --- a/src/build/buildApp.js +++ b/src/build/buildApp.js @@ -105,7 +105,8 @@ function selectAppArgs(options) { ignoreCertificate: options.ignoreCertificate, insecure: options.insecure, flashPluginDir: options.flashPluginDir, - fullScreen: options.fullScreen + fullScreen: options.fullScreen, + maximize: options.maximize }; } diff --git a/src/cli.js b/src/cli.js index 1069e4d..7c1fb0a 100755 --- a/src/cli.js +++ b/src/cli.js @@ -39,6 +39,7 @@ if (require.main === module) { .option('--flash ', 'path to Chrome flash plugin, find it in `Chrome://plugins`') .option('--inject ', 'path to a file to be injected', collect, []) .option('--full-screen', 'if the app should always be started in full screen') + .option('--maximize', 'if the app should always be started maximized') .parse(process.argv); if (!process.argv.slice(2).length) { diff --git a/src/options/optionsMain.js b/src/options/optionsMain.js index 554fe73..351ab58 100644 --- a/src/options/optionsMain.js +++ b/src/options/optionsMain.js @@ -50,7 +50,8 @@ function optionsFactory(inpOptions, callback) { insecure: inpOptions.insecure || false, flashPluginDir: inpOptions.flash || null, inject: inpOptions.inject || null, - fullScreen: inpOptions.fullScreen || false + fullScreen: inpOptions.fullScreen || false, + maximize: inpOptions.maximize || false }; if (inpOptions.honest) {