Remove flag to show dev tools

This commit is contained in:
Jia Hao 2016-01-19 20:28:58 +08:00
parent c7e0242852
commit 9c9fe59ed7
5 changed files with 5 additions and 19 deletions

View File

@ -147,14 +147,6 @@ Height of the packaged application, defaults to `800px`.
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
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).

View File

@ -35,7 +35,7 @@ app.on('ready', function() {
}
}
);
buildMenu(app, mainWindow);
// uncomment to show dev tools for the main window

View File

@ -27,7 +27,7 @@ function buildApp(options, callback) {
async.waterfall([
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) => {
@ -60,10 +60,9 @@ function buildApp(options, callback) {
* @param {number} width
* @param {number} height
* @param {string} userAgent
* @param {boolean} showDevTools
* @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 => {
if (error) {
@ -78,8 +77,7 @@ function copyPlaceholderApp(srcAppDir, tempDir, name, targetURL, badge, width, h
badge: badge,
width: width,
height: height,
userAgent: userAgent,
showDevTools: showDevTools
userAgent: userAgent
};
fs.writeFileSync(path.join(tempDir, '/nativefier.json'), JSON.stringify(appArgs));

View File

@ -27,7 +27,6 @@ function main(program) {
program.width,
program.height,
program.userAgent,
program.showDevTools,
callback);
},
@ -63,7 +62,6 @@ if (require.main === module) {
.option('-w, --width <value>', 'set window width, defaults to 1280px', 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('-d, --show-dev-tools', 'show developer tools when running the app')
.parse(process.argv);
if (!process.argv.slice(2).length) {

View File

@ -22,7 +22,6 @@ function optionsFactory(name,
width = 1280,
height = 800,
userAgent,
showDevTools,
callback) {
if (!validator.isURL(targetUrl, {require_protocol: true})) {
@ -58,8 +57,7 @@ function optionsFactory(name,
badge: badge,
width: width,
height: height,
userAgent: userAgent,
showDevTools: showDevTools
userAgent: userAgent
};
if (name && name.length > 0) {