mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-23 02:28:55 +00:00
Implement command line flag to start app in full screen, resolves #109
This commit is contained in:
parent
1c334a3d7d
commit
31ee80f84f
@ -267,6 +267,14 @@ Example:
|
||||
$ nativefier http://google.com --inject ./some-js-injection.js --inject ./some-css-injection.css ~/Desktop
|
||||
```
|
||||
|
||||
#### [inject]
|
||||
|
||||
```
|
||||
--full-screen
|
||||
```
|
||||
|
||||
Makes the packaged app start in full screen.
|
||||
|
||||
## Programmatic API
|
||||
|
||||
You can use the Nativefier programmatic API as well.
|
||||
|
@ -41,9 +41,17 @@ function createMainWindow(options, onAppQuit, setDockBadge) {
|
||||
preload: path.join(__dirname, 'static', 'preload.js')
|
||||
},
|
||||
// after webpack path here should reference `resources/app/`
|
||||
icon: path.join(__dirname, '../', '/icon.png')
|
||||
icon: path.join(__dirname, '../', '/icon.png'),
|
||||
// set to undefined and not false because explicitly setting to false will disable full screen
|
||||
fullscreen: options.fullScreen || undefined
|
||||
});
|
||||
|
||||
// after first run, no longer force full screen to be true
|
||||
if (options.fullScreen) {
|
||||
options.fullScreen = undefined;
|
||||
fs.writeFileSync(path.join(__dirname, '..', 'nativefier.json'), JSON.stringify(options));
|
||||
}
|
||||
|
||||
let currentZoom = 1;
|
||||
|
||||
const onZoomIn = () => {
|
||||
|
@ -104,7 +104,8 @@ function selectAppArgs(options) {
|
||||
nativefierVersion: options.nativefierVersion,
|
||||
ignoreCertificate: options.ignoreCertificate,
|
||||
insecure: options.insecure,
|
||||
flashPluginDir: options.flashPluginDir
|
||||
flashPluginDir: options.flashPluginDir,
|
||||
fullScreen: options.fullScreen
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@ if (require.main === module) {
|
||||
.option('--insecure', 'enable loading of insecure content, defaults to false')
|
||||
.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')
|
||||
.parse(process.argv);
|
||||
|
||||
if (!process.argv.slice(2).length) {
|
||||
|
@ -49,7 +49,8 @@ function optionsFactory(inpOptions, callback) {
|
||||
ignoreCertificate: inpOptions.ignoreCertificate || false,
|
||||
insecure: inpOptions.insecure || false,
|
||||
flashPluginDir: inpOptions.flash || null,
|
||||
inject: inpOptions.inject || null
|
||||
inject: inpOptions.inject || null,
|
||||
fullScreen: inpOptions.fullScreen || false
|
||||
};
|
||||
|
||||
if (inpOptions.honest) {
|
||||
|
Loading…
Reference in New Issue
Block a user