2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-09-22 17:49:02 +00:00

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. Forces the packaged app to ignore certificate errors.
#### [disable-web-security]
```
--disable-web-security
```
Forces the packaged app to ignore web security errors.
#### [flash] #### [flash]
``` ```
@ -273,6 +280,7 @@ var options = {
showMenuBar: false, showMenuBar: false,
userAgent: null, userAgent: null,
insecure: false, insecure: false,
disableWebSecurity: false,
honest: false honest: false
}; };

View File

@ -36,6 +36,7 @@ function createMainWindow(options, onAppQuit, setDockBadge) {
plugins: true, plugins: true,
// node globals causes problems with sites like messenger.com // node globals causes problems with sites like messenger.com
nodeIntegration: false, nodeIntegration: false,
webSecurity: !options.disableWebSecurity,
preload: path.join(__dirname, 'static', 'preload.js') preload: path.join(__dirname, 'static', 'preload.js')
}, },
// after webpack path here should reference `resources/app/` // 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 * Only picks certain app args to pass to nativefier.json
* @param options * @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) { function selectAppArgs(options) {
return { return {
@ -52,6 +52,7 @@ function selectAppArgs(options) {
userAgent: options.userAgent, userAgent: options.userAgent,
nativefierVersion: options.nativefierVersion, nativefierVersion: options.nativefierVersion,
insecure: options.insecure, insecure: options.insecure,
disableWebSecurity: options.disableWebSecurity,
flashPluginDir: options.flashPluginDir 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('-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('--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('--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`') .option('--flash <value>', 'path to Chrome flash plugin, find it in `Chrome://plugins`')
.parse(process.argv); .parse(process.argv);

View File

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