mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-22 22:58:33 +00:00
Merge pull request #187 from janjongboom/disable_context_menu
Add an option to disable the context menu
This commit is contained in:
commit
810d282ede
@ -116,7 +116,9 @@ function createMainWindow(options, onAppQuit, setDockBadge) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
createMenu(menuOptions);
|
createMenu(menuOptions);
|
||||||
|
if (!options.disableContextMenu) {
|
||||||
initContextMenu(mainWindow);
|
initContextMenu(mainWindow);
|
||||||
|
}
|
||||||
|
|
||||||
if (options.userAgent) {
|
if (options.userAgent) {
|
||||||
mainWindow.webContents.setUserAgent(options.userAgent);
|
mainWindow.webContents.setUserAgent(options.userAgent);
|
||||||
|
@ -254,6 +254,14 @@ Makes the packaged app start maximized.
|
|||||||
|
|
||||||
Shows detailed logs in the console.
|
Shows detailed logs in the console.
|
||||||
|
|
||||||
|
#### [disable-context-menu]
|
||||||
|
|
||||||
|
```
|
||||||
|
--disable-context-menu
|
||||||
|
```
|
||||||
|
|
||||||
|
Disable the context menu
|
||||||
|
|
||||||
## Programmatic API
|
## Programmatic API
|
||||||
|
|
||||||
You can use the Nativefier programmatic API as well.
|
You can use the Nativefier programmatic API as well.
|
||||||
|
@ -106,7 +106,8 @@ function selectAppArgs(options) {
|
|||||||
insecure: options.insecure,
|
insecure: options.insecure,
|
||||||
flashPluginDir: options.flashPluginDir,
|
flashPluginDir: options.flashPluginDir,
|
||||||
fullScreen: options.fullScreen,
|
fullScreen: options.fullScreen,
|
||||||
maximize: options.maximize
|
maximize: options.maximize,
|
||||||
|
disableContextMenu: options.disableContextMenu
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ if (require.main === module) {
|
|||||||
.option('--full-screen', 'if the app should always be started in full screen')
|
.option('--full-screen', 'if the app should always be started in full screen')
|
||||||
.option('--maximize', 'if the app should always be started maximized')
|
.option('--maximize', 'if the app should always be started maximized')
|
||||||
.option('--verbose', 'if verbose logs should be displayed')
|
.option('--verbose', 'if verbose logs should be displayed')
|
||||||
|
.option('--disable-context-menu', 'disable the context menu')
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
if (!process.argv.slice(2).length) {
|
if (!process.argv.slice(2).length) {
|
||||||
|
@ -55,7 +55,8 @@ function optionsFactory(inpOptions, callback) {
|
|||||||
ignore: 'src',
|
ignore: 'src',
|
||||||
fullScreen: inpOptions.fullScreen || false,
|
fullScreen: inpOptions.fullScreen || false,
|
||||||
maximize: inpOptions.maximize || false,
|
maximize: inpOptions.maximize || false,
|
||||||
verbose: inpOptions.verbose
|
verbose: inpOptions.verbose,
|
||||||
|
disableContextMenu: inpOptions.disableContextMenu
|
||||||
};
|
};
|
||||||
|
|
||||||
if (options.verbose) {
|
if (options.verbose) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user