diff --git a/app/src/components/mainWindow/mainWindow.js b/app/src/components/mainWindow/mainWindow.js index 5d8ae55..7b6af0d 100644 --- a/app/src/components/mainWindow/mainWindow.js +++ b/app/src/components/mainWindow/mainWindow.js @@ -89,6 +89,8 @@ function createMainWindow(inpOptions, onAppQuit, setDockBadge) { icon: getAppIcon(), // set to undefined and not false because explicitly setting to false will disable full screen fullscreen: options.fullScreen || undefined, + // Whether the window should always stay on top of other windows. Default is false. + alwaysOnTop: options.alwaysOnTop, }); mainWindowState.manage(mainWindow); diff --git a/docs/api.md b/docs/api.md index f7c2613..c38862a 100644 --- a/docs/api.md +++ b/docs/api.md @@ -46,6 +46,7 @@ - [[tray]](#tray) - [[basic-auth-username]](#basic-auth-username) - [[basic-auth-password]](#basic-auth-username) + - [[always-on-top]](#always-on-top) - [Programmatic API](#programmatic-api) ## Command Line @@ -489,6 +490,16 @@ Example: nativefier --file-download-options '{"saveAs": true}' ``` +#### [always-on-top] + +``` +--always-on-top +``` + +Enable always on top for the packaged application. + + + ## Programmatic API You can use the Nativefier programmatic API as well. diff --git a/src/build/buildApp.js b/src/build/buildApp.js index 22ae2a0..b40b78e 100644 --- a/src/build/buildApp.js +++ b/src/build/buildApp.js @@ -52,6 +52,7 @@ function selectAppArgs(options) { tray: options.tray, basicAuthUsername: options.basicAuthUsername, basicAuthPassword: options.basicAuthPassword, + alwaysOnTop: options.alwaysOnTop, }; } diff --git a/src/cli.js b/src/cli.js index 2872541..8c219dd 100755 --- a/src/cli.js +++ b/src/cli.js @@ -89,6 +89,7 @@ if (require.main === module) { .option('--tray', 'allow app to stay in system tray') .option('--basic-auth-username ', 'basic http(s) auth username') .option('--basic-auth-password ', 'basic http(s) auth password') + .option('--always-on-top', 'enable always on top window') .parse(process.argv); if (!process.argv.slice(2).length) { diff --git a/src/options/optionsMain.js b/src/options/optionsMain.js index 9144aad..0982016 100644 --- a/src/options/optionsMain.js +++ b/src/options/optionsMain.js @@ -70,6 +70,7 @@ export default function (inpOptions) { tray: inpOptions.tray || false, basicAuthUsername: inpOptions.basicAuthUsername || null, basicAuthPassword: inpOptions.basicAuthPassword || null, + alwaysOnTop: inpOptions.alwaysOnTop || false, }; if (options.verbose) {