mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-22 22:58:33 +00:00
Added a --zoom option for setting default zoom (#218)
* Added a --zoom option for setting initial zoom * Added information about --zoom to documentation
This commit is contained in:
parent
707cc8b730
commit
a407b9ea52
@ -42,7 +42,8 @@ function createMainWindow(options, onAppQuit, setDockBadge) {
|
|||||||
// node globals causes problems with sites like messenger.com
|
// node globals causes problems with sites like messenger.com
|
||||||
nodeIntegration: false,
|
nodeIntegration: false,
|
||||||
webSecurity: !options.insecure,
|
webSecurity: !options.insecure,
|
||||||
preload: path.join(__dirname, 'static', 'preload.js')
|
preload: path.join(__dirname, 'static', 'preload.js'),
|
||||||
|
zoomFactor: options.zoom
|
||||||
},
|
},
|
||||||
// after webpack path here should reference `resources/app/`
|
// after webpack path here should reference `resources/app/`
|
||||||
icon: path.join(__dirname, '../', '/icon.png'),
|
icon: path.join(__dirname, '../', '/icon.png'),
|
||||||
|
12
docs/api.md
12
docs/api.md
@ -35,6 +35,7 @@
|
|||||||
- [[verbose]](#verbose)
|
- [[verbose]](#verbose)
|
||||||
- [[disable-context-menu]](#disable-context-menu)
|
- [[disable-context-menu]](#disable-context-menu)
|
||||||
- [[disable-dev-tools]](#disable-dev-tools)
|
- [[disable-dev-tools]](#disable-dev-tools)
|
||||||
|
- [[zoom]](#zoom)
|
||||||
- [Programmatic API](#programmatic-api)
|
- [Programmatic API](#programmatic-api)
|
||||||
|
|
||||||
## Command Line
|
## Command Line
|
||||||
@ -327,6 +328,14 @@ Disable the context menu
|
|||||||
|
|
||||||
Disable the Chrome developer tools
|
Disable the Chrome developer tools
|
||||||
|
|
||||||
|
#### [zoom]
|
||||||
|
|
||||||
|
```
|
||||||
|
--zoom <value>
|
||||||
|
```
|
||||||
|
|
||||||
|
Sets a default zoom factor to be used when the app is opened, defaults to `1.0`.
|
||||||
|
|
||||||
## Programmatic API
|
## Programmatic API
|
||||||
|
|
||||||
You can use the Nativefier programmatic API as well.
|
You can use the Nativefier programmatic API as well.
|
||||||
@ -360,7 +369,8 @@ var options = {
|
|||||||
userAgent: 'Mozilla ...', // will infer a default for your current system
|
userAgent: 'Mozilla ...', // will infer a default for your current system
|
||||||
ignoreCertificate: false,
|
ignoreCertificate: false,
|
||||||
insecure: false,
|
insecure: false,
|
||||||
honest: false
|
honest: false,
|
||||||
|
zoom: 1.0
|
||||||
};
|
};
|
||||||
|
|
||||||
nativefier(options, function(error, appPath) {
|
nativefier(options, function(error, appPath) {
|
||||||
|
@ -114,7 +114,8 @@ function selectAppArgs(options) {
|
|||||||
hideWindowFrame: options.hideWindowFrame,
|
hideWindowFrame: options.hideWindowFrame,
|
||||||
maximize: options.maximize,
|
maximize: options.maximize,
|
||||||
disableContextMenu: options.disableContextMenu,
|
disableContextMenu: options.disableContextMenu,
|
||||||
disableDevTools: options.disableDevTools
|
disableDevTools: options.disableDevTools,
|
||||||
|
zoom: options.zoom
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ if (require.main === module) {
|
|||||||
.option('--verbose', 'if verbose logs should be displayed')
|
.option('--verbose', 'if verbose logs should be displayed')
|
||||||
.option('--disable-context-menu', 'disable the context menu')
|
.option('--disable-context-menu', 'disable the context menu')
|
||||||
.option('--disable-dev-tools', 'disable developer tools')
|
.option('--disable-dev-tools', 'disable developer tools')
|
||||||
|
.option('--zoom <value>', 'default zoom factor to use when the app is opened, defaults to 1.0', parseFloat)
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
if (!process.argv.slice(2).length) {
|
if (!process.argv.slice(2).length) {
|
||||||
|
@ -65,7 +65,8 @@ function optionsFactory(inpOptions, callback) {
|
|||||||
disableContextMenu: inpOptions.disableContextMenu,
|
disableContextMenu: inpOptions.disableContextMenu,
|
||||||
disableDevTools: inpOptions.disableDevTools,
|
disableDevTools: inpOptions.disableDevTools,
|
||||||
// workaround for electron-packager#375
|
// workaround for electron-packager#375
|
||||||
tmpdir: false
|
tmpdir: false,
|
||||||
|
zoom: inpOptions.zoom || 1.0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (options.verbose) {
|
if (options.verbose) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user