mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-11-11 07:41:04 +00:00
Remove flag to show dev tools
This commit is contained in:
parent
c7e0242852
commit
9c9fe59ed7
@ -147,14 +147,6 @@ Height of the packaged application, defaults to `800px`.
|
|||||||
|
|
||||||
Set the user agent to run the created app with.
|
Set the user agent to run the created app with.
|
||||||
|
|
||||||
#### [show-dev-tools]
|
|
||||||
|
|
||||||
```
|
|
||||||
'-d, --show-dev-tools'
|
|
||||||
```
|
|
||||||
|
|
||||||
Show developer tools when running the app.
|
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
A template app with the appropriate event listeners and callbacks set up is included in the `./app` folder. When the `nativefier` command is executed, this folder is copied to a temporary directory with the appropriate parameters in a configuration file, and is packaged into an app with [Electron Packager](https://github.com/maxogden/electron-packager).
|
A template app with the appropriate event listeners and callbacks set up is included in the `./app` folder. When the `nativefier` command is executed, this folder is copied to a temporary directory with the appropriate parameters in a configuration file, and is packaged into an app with [Electron Packager](https://github.com/maxogden/electron-packager).
|
||||||
|
@ -35,7 +35,7 @@ app.on('ready', function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
buildMenu(app, mainWindow);
|
buildMenu(app, mainWindow);
|
||||||
|
|
||||||
// uncomment to show dev tools for the main window
|
// uncomment to show dev tools for the main window
|
||||||
|
@ -27,7 +27,7 @@ function buildApp(options, callback) {
|
|||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
callback => {
|
callback => {
|
||||||
copyPlaceholderApp(options.dir, tmpPath, options.name, options.targetUrl, options.badge, options.width, options.height, options.userAgent, options.showDevTools, callback);
|
copyPlaceholderApp(options.dir, tmpPath, options.name, options.targetUrl, options.badge, options.width, options.height, options.userAgent, callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
(tempDir, callback) => {
|
(tempDir, callback) => {
|
||||||
@ -60,10 +60,9 @@ function buildApp(options, callback) {
|
|||||||
* @param {number} width
|
* @param {number} width
|
||||||
* @param {number} height
|
* @param {number} height
|
||||||
* @param {string} userAgent
|
* @param {string} userAgent
|
||||||
* @param {boolean} showDevTools
|
|
||||||
* @param {tempDirCallback} callback
|
* @param {tempDirCallback} callback
|
||||||
*/
|
*/
|
||||||
function copyPlaceholderApp(srcAppDir, tempDir, name, targetURL, badge, width, height, userAgent, showDevTools, callback) {
|
function copyPlaceholderApp(srcAppDir, tempDir, name, targetURL, badge, width, height, userAgent, callback) {
|
||||||
copy(srcAppDir, tempDir, error => {
|
copy(srcAppDir, tempDir, error => {
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -78,8 +77,7 @@ function copyPlaceholderApp(srcAppDir, tempDir, name, targetURL, badge, width, h
|
|||||||
badge: badge,
|
badge: badge,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
userAgent: userAgent,
|
userAgent: userAgent
|
||||||
showDevTools: showDevTools
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.writeFileSync(path.join(tempDir, '/nativefier.json'), JSON.stringify(appArgs));
|
fs.writeFileSync(path.join(tempDir, '/nativefier.json'), JSON.stringify(appArgs));
|
||||||
|
@ -27,7 +27,6 @@ function main(program) {
|
|||||||
program.width,
|
program.width,
|
||||||
program.height,
|
program.height,
|
||||||
program.userAgent,
|
program.userAgent,
|
||||||
program.showDevTools,
|
|
||||||
callback);
|
callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -63,7 +62,6 @@ if (require.main === module) {
|
|||||||
.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('-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('-d, --show-dev-tools', 'show developer tools when running the app')
|
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
if (!process.argv.slice(2).length) {
|
if (!process.argv.slice(2).length) {
|
||||||
|
@ -22,7 +22,6 @@ function optionsFactory(name,
|
|||||||
width = 1280,
|
width = 1280,
|
||||||
height = 800,
|
height = 800,
|
||||||
userAgent,
|
userAgent,
|
||||||
showDevTools,
|
|
||||||
callback) {
|
callback) {
|
||||||
|
|
||||||
if (!validator.isURL(targetUrl, {require_protocol: true})) {
|
if (!validator.isURL(targetUrl, {require_protocol: true})) {
|
||||||
@ -58,8 +57,7 @@ function optionsFactory(name,
|
|||||||
badge: badge,
|
badge: badge,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
userAgent: userAgent,
|
userAgent: userAgent
|
||||||
showDevTools: showDevTools
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (name && name.length > 0) {
|
if (name && name.length > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user