mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-11 01:32:04 +00:00
Merge branch 'fearenales-feature/show-menu-bar'
This commit is contained in:
commit
b83a34934f
@ -159,6 +159,14 @@ Width of the packaged application, defaults to `1280px`.
|
|||||||
|
|
||||||
Height of the packaged application, defaults to `800px`.
|
Height of the packaged application, defaults to `800px`.
|
||||||
|
|
||||||
|
#### [show-menu-bar]
|
||||||
|
|
||||||
|
```
|
||||||
|
-m, --show-menu-bar
|
||||||
|
```
|
||||||
|
|
||||||
|
Specifies if the menu bar should be shown.
|
||||||
|
|
||||||
#### [user-agent]
|
#### [user-agent]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -3,5 +3,6 @@
|
|||||||
"targetUrl": "http:\/\/www.google.com",
|
"targetUrl": "http:\/\/www.google.com",
|
||||||
"badge": false,
|
"badge": false,
|
||||||
"width": 1280,
|
"width": 1280,
|
||||||
"height": 800
|
"height": 800,
|
||||||
|
"showMenuBar": false,
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ function createMainWindow(options, onAppQuit, setDockBadge) {
|
|||||||
height: mainWindowState.height,
|
height: mainWindowState.height,
|
||||||
x: mainWindowState.x,
|
x: mainWindowState.x,
|
||||||
y: mainWindowState.y,
|
y: mainWindowState.y,
|
||||||
|
'auto-hide-menu-bar': !options.showMenuBar,
|
||||||
title: options.name,
|
title: options.name,
|
||||||
'web-preferences': {
|
'web-preferences': {
|
||||||
javascript: true,
|
javascript: true,
|
||||||
|
@ -31,7 +31,7 @@ function buildApp(options, callback) {
|
|||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
callback => {
|
callback => {
|
||||||
copyPlaceholderApp(options.dir, tmpPath, options.name, options.targetUrl, options.counter, options.width, options.height, options.userAgent, callback);
|
copyPlaceholderApp(options.dir, tmpPath, options.name, options.targetUrl, options.counter, options.width, options.height, options.showMenuBar, options.userAgent, callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
(tempDir, callback) => {
|
(tempDir, callback) => {
|
||||||
@ -62,10 +62,11 @@ function buildApp(options, callback) {
|
|||||||
* @param {boolean} counter
|
* @param {boolean} counter
|
||||||
* @param {number} width
|
* @param {number} width
|
||||||
* @param {number} height
|
* @param {number} height
|
||||||
|
* @param {boolean} showMenuBar
|
||||||
* @param {string} userAgent
|
* @param {string} userAgent
|
||||||
* @param {tempDirCallback} callback
|
* @param {tempDirCallback} callback
|
||||||
*/
|
*/
|
||||||
function copyPlaceholderApp(srcAppDir, tempDir, name, targetURL, counter, width, height, userAgent, callback) {
|
function copyPlaceholderApp(srcAppDir, tempDir, name, targetURL, counter, width, height, showMenuBar, userAgent, callback) {
|
||||||
const loadedPackageJson = packageJson;
|
const loadedPackageJson = packageJson;
|
||||||
copy(srcAppDir, tempDir, function(error) {
|
copy(srcAppDir, tempDir, function(error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -80,6 +81,7 @@ function copyPlaceholderApp(srcAppDir, tempDir, name, targetURL, counter, width,
|
|||||||
counter: counter,
|
counter: counter,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
|
showMenuBar: showMenuBar,
|
||||||
userAgent: userAgent,
|
userAgent: userAgent,
|
||||||
nativefierVersion: loadedPackageJson.version
|
nativefierVersion: loadedPackageJson.version
|
||||||
};
|
};
|
||||||
|
@ -25,6 +25,7 @@ function main(program) {
|
|||||||
program.counter,
|
program.counter,
|
||||||
program.width,
|
program.width,
|
||||||
program.height,
|
program.height,
|
||||||
|
program.showMenuBar,
|
||||||
program.userAgent,
|
program.userAgent,
|
||||||
program.honest,
|
program.honest,
|
||||||
callback);
|
callback);
|
||||||
@ -38,7 +39,6 @@ function main(program) {
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`App built to ${appPath}`);
|
console.log(`App built to ${appPath}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -61,6 +61,7 @@ if (require.main === module) {
|
|||||||
.option('-i, --icon <value>', 'the icon file to use as the icon for the app (should be a .icns file on OSX)')
|
.option('-i, --icon <value>', 'the icon file to use as the icon for the app (should be a .icns file on OSX)')
|
||||||
.option('-w, --width <value>', 'set window width, defaults to 1280px', parseInt)
|
.option('-w, --width <value>', 'set window width, defaults to 1280px', parseInt)
|
||||||
.option('-h, --height <value>', 'set window height, defaults to 800px', parseInt)
|
.option('-h, --height <value>', 'set window height, defaults to 800px', parseInt)
|
||||||
|
.option('-m, --show-menu-bar', 'set menu bar visible, defaults to false')
|
||||||
.option('-u, --user-agent <value>', 'set the user agent string for the app')
|
.option('-u, --user-agent <value>', 'set the user agent string for the app')
|
||||||
.option('--honest', 'prevent the nativefied app from changing the user agent string to masquerade as a regular chrome browser')
|
.option('--honest', 'prevent the nativefied app from changing the user agent string to masquerade as a regular chrome browser')
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
@ -22,6 +22,7 @@ function optionsFactory(name,
|
|||||||
counter = false,
|
counter = false,
|
||||||
width = 1280,
|
width = 1280,
|
||||||
height = 800,
|
height = 800,
|
||||||
|
showMenuBar = false,
|
||||||
userAgent,
|
userAgent,
|
||||||
honest = false,
|
honest = false,
|
||||||
callback) {
|
callback) {
|
||||||
@ -60,6 +61,7 @@ function optionsFactory(name,
|
|||||||
counter: counter,
|
counter: counter,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
|
showMenuBar: showMenuBar,
|
||||||
userAgent: userAgent
|
userAgent: userAgent
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user