No longer enable flash by default

Flash should be enabled with `--flash`, which will also enable the `--insecure` flag
This commit is contained in:
Jia Hao 2016-03-26 15:06:50 +08:00
parent 62a43c76ed
commit 404bab30c3
5 changed files with 23 additions and 9 deletions

View File

@ -38,7 +38,7 @@ View the changelog [here](docs/changelog.md).
### Features
- Automatically retrieves the correct icon and app name
- Flash Support (Needs Testing)
- Flash Support (with [`--flash`](docs/api.md#flash) flag)
- Javascript and CSS injection
## Installation

View File

@ -15,9 +15,9 @@ const appArgs = JSON.parse(fs.readFileSync(APP_ARGS_FILE_PATH, 'utf8'));
let mainWindow;
if (appArgs.flashPluginDir) {
if (typeof appArgs.flashPluginDir === 'string') {
app.commandLine.appendSwitch('ppapi-flash-path', appArgs.flashPluginDir);
} else {
} else if (appArgs.flashPluginDir) {
const flashPath = inferFlash();
app.commandLine.appendSwitch('ppapi-flash-path', flashPath);
}

View File

@ -23,6 +23,7 @@
- [[ignore-certificate]](#ignore-certificate)
- [[insecure]](#insecure)
- [[flash]](#flash)
- [[flash-path]](#flash-path)
- [[inject]](#inject)
- [[full-screen]](#full-screen)
- [[maximize]](#maximize)
@ -194,17 +195,25 @@ Forces the packaged app to ignore certificate errors.
```
--insecure
```
Forces the packaged app to ignore web security errors.
Forces the packaged app to ignore web security errors, such as [Mixed Content](https://developer.mozilla.org/en-US/docs/Security/Mixed_content) errors when receiving HTTP content on a HTTPS site.
#### [flash]
```
--flash <value>
--flash
```
By default, Nativefier will automatically try to determine the location of your Google Chrome flash binary. In the event that Flash does not appear to work, you can specify it directly with this command line flag, by retrieving the location of the Flash path from [chrome://plugins](chrome://plugins), under `Adobe Flash Player` > `Location`.
If `--flash` is specified, Nativefier will automatically try to determine the location of your Google Chrome flash binary. Take note that the version of Chrome on your computer should be the same as the version used by the version of Electron for the Nativefied package.
From my experience, it might be helpful to pass the `--insecure` flag if you are using nativefied flash apps, as some `https` websites tend to serve flash insecurely.
Take note that if this flag is specified, the `--insecure` flag will be added automatically, to prevent the Mixed Content errors on sites such as [Twitch.tv](https://www.twitch.tv/).
#### [flash-path]
```
--flash-path <value>
```
You can also specify the path to the Chrome flash plugin directly with this flag. The path can be found at [chrome://plugins](chrome://plugins), under `Adobe Flash Player` > `Location`. This flag automatically enables the `--flash` flag as well.
#### [inject]

View File

@ -36,7 +36,8 @@ if (require.main === module) {
.option('--honest', 'prevent the nativefied app from changing the user agent string to masquerade as a regular chrome browser')
.option('--ignore-certificate', 'ignore certificate related errors')
.option('--insecure', 'enable loading of insecure content, defaults to false')
.option('--flash <value>', 'path to Chrome flash plugin, find it in `Chrome://plugins`')
.option('--flash', 'if flash should be enabled')
.option('--flash-path <value>', 'path to Chrome flash plugin, find it in `Chrome://plugins`')
.option('--inject <value>', 'path to a file to be injected', collect, [])
.option('--full-screen', 'if the app should always be started in full screen')
.option('--maximize', 'if the app should always be started maximized')

View File

@ -50,7 +50,7 @@ function optionsFactory(inpOptions, callback) {
userAgent: inpOptions.userAgent,
ignoreCertificate: inpOptions.ignoreCertificate || false,
insecure: inpOptions.insecure || false,
flashPluginDir: inpOptions.flash || null,
flashPluginDir: inpOptions.flashPath || inpOptions.flash || null,
inject: inpOptions.inject || null,
ignore: 'src',
fullScreen: inpOptions.fullScreen || false,
@ -64,6 +64,10 @@ function optionsFactory(inpOptions, callback) {
log.setLevel('error');
}
if (options.flashPluginDir) {
options.insecure = true;
}
if (inpOptions.honest) {
options.userAgent = null;
}