mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-23 10:38:55 +00:00
No longer enable flash by default
Flash should be enabled with `--flash`, which will also enable the `--insecure` flag
This commit is contained in:
parent
62a43c76ed
commit
404bab30c3
@ -38,7 +38,7 @@ View the changelog [here](docs/changelog.md).
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
- Automatically retrieves the correct icon and app name
|
- 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
|
- Javascript and CSS injection
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
@ -15,9 +15,9 @@ const appArgs = JSON.parse(fs.readFileSync(APP_ARGS_FILE_PATH, 'utf8'));
|
|||||||
|
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
|
|
||||||
if (appArgs.flashPluginDir) {
|
if (typeof appArgs.flashPluginDir === 'string') {
|
||||||
app.commandLine.appendSwitch('ppapi-flash-path', appArgs.flashPluginDir);
|
app.commandLine.appendSwitch('ppapi-flash-path', appArgs.flashPluginDir);
|
||||||
} else {
|
} else if (appArgs.flashPluginDir) {
|
||||||
const flashPath = inferFlash();
|
const flashPath = inferFlash();
|
||||||
app.commandLine.appendSwitch('ppapi-flash-path', flashPath);
|
app.commandLine.appendSwitch('ppapi-flash-path', flashPath);
|
||||||
}
|
}
|
||||||
|
17
docs/api.md
17
docs/api.md
@ -23,6 +23,7 @@
|
|||||||
- [[ignore-certificate]](#ignore-certificate)
|
- [[ignore-certificate]](#ignore-certificate)
|
||||||
- [[insecure]](#insecure)
|
- [[insecure]](#insecure)
|
||||||
- [[flash]](#flash)
|
- [[flash]](#flash)
|
||||||
|
- [[flash-path]](#flash-path)
|
||||||
- [[inject]](#inject)
|
- [[inject]](#inject)
|
||||||
- [[full-screen]](#full-screen)
|
- [[full-screen]](#full-screen)
|
||||||
- [[maximize]](#maximize)
|
- [[maximize]](#maximize)
|
||||||
@ -194,17 +195,25 @@ Forces the packaged app to ignore certificate errors.
|
|||||||
```
|
```
|
||||||
--insecure
|
--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]
|
||||||
|
|
||||||
```
|
```
|
||||||
--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]
|
#### [inject]
|
||||||
|
|
||||||
|
@ -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('--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('--ignore-certificate', 'ignore certificate related errors')
|
||||||
.option('--insecure', 'enable loading of insecure content, defaults to false')
|
.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('--inject <value>', 'path to a file to be injected', collect, [])
|
||||||
.option('--full-screen', 'if the app should always be started in full screen')
|
.option('--full-screen', 'if the app should always be started in full screen')
|
||||||
.option('--maximize', 'if the app should always be started maximized')
|
.option('--maximize', 'if the app should always be started maximized')
|
||||||
|
@ -50,7 +50,7 @@ function optionsFactory(inpOptions, callback) {
|
|||||||
userAgent: inpOptions.userAgent,
|
userAgent: inpOptions.userAgent,
|
||||||
ignoreCertificate: inpOptions.ignoreCertificate || false,
|
ignoreCertificate: inpOptions.ignoreCertificate || false,
|
||||||
insecure: inpOptions.insecure || false,
|
insecure: inpOptions.insecure || false,
|
||||||
flashPluginDir: inpOptions.flash || null,
|
flashPluginDir: inpOptions.flashPath || inpOptions.flash || null,
|
||||||
inject: inpOptions.inject || null,
|
inject: inpOptions.inject || null,
|
||||||
ignore: 'src',
|
ignore: 'src',
|
||||||
fullScreen: inpOptions.fullScreen || false,
|
fullScreen: inpOptions.fullScreen || false,
|
||||||
@ -64,6 +64,10 @@ function optionsFactory(inpOptions, callback) {
|
|||||||
log.setLevel('error');
|
log.setLevel('error');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.flashPluginDir) {
|
||||||
|
options.insecure = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (inpOptions.honest) {
|
if (inpOptions.honest) {
|
||||||
options.userAgent = null;
|
options.userAgent = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user