2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-23 02:28:55 +00:00

Fix #549: Add --always-on-top build flag (PR #551)

This commit is contained in:
sgroh 2018-03-16 19:15:44 -03:00 committed by Ronan Jouchet
parent 8981e55783
commit 46d381481c
5 changed files with 16 additions and 0 deletions

View File

@ -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);

View File

@ -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 <your-website> --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.

View File

@ -52,6 +52,7 @@ function selectAppArgs(options) {
tray: options.tray,
basicAuthUsername: options.basicAuthUsername,
basicAuthPassword: options.basicAuthPassword,
alwaysOnTop: options.alwaysOnTop,
};
}

View File

@ -89,6 +89,7 @@ if (require.main === module) {
.option('--tray', 'allow app to stay in system tray')
.option('--basic-auth-username <value>', 'basic http(s) auth username')
.option('--basic-auth-password <value>', 'basic http(s) auth password')
.option('--always-on-top', 'enable always on top window')
.parse(process.argv);
if (!process.argv.slice(2).length) {

View File

@ -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) {