mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-23 10:38:55 +00:00
Merge pull request #170 from BugiDev/feature/maximization
Added option for maximization of main window ( #133 )
This commit is contained in:
commit
f4f315bb5f
@ -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 = () => {
|
||||
|
10
docs/api.md
10
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.
|
||||
|
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@ if (require.main === module) {
|
||||
.option('--flash <value>', 'path to Chrome flash plugin, find it in `Chrome://plugins`')
|
||||
.option('--inject <value>', '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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user