Merge branch 'development' into feature/flash

# Conflicts:
#	README.md
#	src/build/buildApp.js
#	src/cli.js
#	src/options/optionsMain.js
This commit is contained in:
Jia Hao 2016-02-23 21:13:20 +08:00
commit 7bfa42ef71
5 changed files with 15 additions and 2 deletions

View File

@ -235,6 +235,13 @@ If this flag is passed, it will not override the user agent.
```
Forces the packaged app to ignore certificate errors.
#### [disable-web-security]
```
--disable-web-security
```
Forces the packaged app to ignore web security errors.
#### [flash]
```
@ -273,6 +280,7 @@ var options = {
showMenuBar: false,
userAgent: null,
insecure: false,
disableWebSecurity: false,
honest: false
};

View File

@ -36,6 +36,7 @@ function createMainWindow(options, onAppQuit, setDockBadge) {
plugins: true,
// node globals causes problems with sites like messenger.com
nodeIntegration: false,
webSecurity: !options.disableWebSecurity,
preload: path.join(__dirname, 'static', 'preload.js')
},
// after webpack path here should reference `resources/app/`

View File

@ -39,7 +39,7 @@ function changeAppPackageJsonName(appPath, name) {
/**
* Only picks certain app args to pass to nativefier.json
* @param options
* @returns {{name: (*|string), targetUrl: (string|*), counter: *, width: *, height: *, showMenuBar: *, userAgent: *, nativefierVersion: *, insecure: *}}
* @returns {{name: (*|string), targetUrl: (string|*), counter: *, width: *, height: *, showMenuBar: *, userAgent: *, nativefierVersion: *, insecure: *, disableWebSecurity: *}}
*/
function selectAppArgs(options) {
return {
@ -52,6 +52,7 @@ function selectAppArgs(options) {
userAgent: options.userAgent,
nativefierVersion: options.nativefierVersion,
insecure: options.insecure,
disableWebSecurity: options.disableWebSecurity,
flashPluginDir: options.flashPluginDir
};
}

View File

@ -29,6 +29,7 @@ if (require.main === module) {
.option('-u, --user-agent <value>', 'set the user agent string for the app')
.option('--honest', 'prevent the nativefied app from changing the user agent string to masquerade as a regular chrome browser')
.option('--insecure', 'ignore certificate related errors')
.option('--disable-web-security', 'enable loading of insecure content, defaults to false')
.option('--flash <value>', 'path to Chrome flash plugin, find it in `Chrome://plugins`')
.parse(process.argv);

View File

@ -35,7 +35,7 @@ function optionsFactory(inpOptions, callback) {
targetUrl: normalizeUrl(inpOptions.targetUrl),
platform: inpOptions.platform || inferPlatform(),
arch: inpOptions.arch || inferArch(),
version: ELECTRON_VERSION,
version: inpOptions.electronVersion || ELECTRON_VERSION,
nativefierVersion: packageJson.version,
out: inpOptions.out || process.cwd(),
overwrite: inpOptions.overwrite || false,
@ -47,6 +47,7 @@ function optionsFactory(inpOptions, callback) {
showMenuBar: inpOptions.showMenuBar || false,
userAgent: inpOptions.userAgent || getFakeUserAgent(),
insecure: inpOptions.insecure || false,
disableWebSecurity: inpOptions.disableWebSecurity || false,
flashPluginDir: inpOptions.flash || null
};
@ -70,6 +71,7 @@ function optionsFactory(inpOptions, callback) {
});
},
callback => {
// length also checks if its the commanderJS function or a string
if (options.name && options.name.length > 0) {
callback();
return;