diff --git a/README.md b/README.md index ef418c4..02fea71 100644 --- a/README.md +++ b/README.md @@ -35,14 +35,6 @@ Nativefier will intelligently attempt to determine the app name, your OS and pro $ nativefier --app-name "Some Awesome App" "http://medium.com" ``` -Certain websites such as WhatsApp Web might say that your browser is unsupported. To get around this, simply pass in the `--pretend` flag, as such: - -``` -$ nativefier --pretend "http://web.whatsapp.com" -``` - -This will use a preset user agent string to make the website think you're accessing it from a regular Google Chrome browser. - Other command line options are listed below. ## Options @@ -136,7 +128,7 @@ There is no known way to intercept and set an event listener for a desktop notif However, this would cause issues when the command line argument `target` is set to a external page which is not a single page app, because clicking on hyperlinks and switching pages would naturally change the `document.title`. Hence, `--badge` is an optional command argument that can be set by the user if the side effect of this workaround is understood. -#### [counter[ +#### [counter] ``` --counter @@ -168,12 +160,14 @@ Height of the packaged application, defaults to `800px`. Set the user agent to run the created app with. -### [pretend] -``` --p, --pretend -``` +### [honest] -Uses a preset user agent string for your OS and pretends to be a regular Google Chrome browser. +``` +--honest +``` +By default, nativefier uses a preset user agent string for your OS and masquerades as a regular Google Chrome browser, so that sites like WhatsApp Web will not say that the current browser is unsupported. + +If this flag is passed, it will not override the user agent. ## How It Works diff --git a/src/cli.js b/src/cli.js index 6edafad..8dbf778 100755 --- a/src/cli.js +++ b/src/cli.js @@ -28,7 +28,7 @@ function main(program) { program.width, program.height, program.userAgent, - program.pretend, + program.honest, callback); }, @@ -65,7 +65,7 @@ if (require.main === module) { .option('-w, --width ', 'set window width, defaults to 1280px', parseInt) .option('-h, --height ', 'set window height, defaults to 800px', parseInt) .option('-u, --user-agent ', 'set the user agent string for the app') - .option('-p, --pretend', 'pretends to be a normal chrome browser') + .option('--honest', 'prevent the nativefied app from changing the user agent string to masquerade as a regular chrome browser') .parse(process.argv); if (!process.argv.slice(2).length) { diff --git a/src/options.js b/src/options.js index 2744e43..75f9cbe 100644 --- a/src/options.js +++ b/src/options.js @@ -24,7 +24,7 @@ function optionsFactory(name, width = 1280, height = 800, userAgent, - pretend, + honest = false, callback) { targetUrl = normalizeUrl(targetUrl); @@ -37,7 +37,7 @@ function optionsFactory(name, height = 800; } - if (!userAgent && pretend) { + if (!userAgent && !honest) { userAgent = getFakeUserAgent(); }