diff --git a/index.js b/index.js index c681c0d..dd4cc6a 100755 --- a/index.js +++ b/index.js @@ -47,6 +47,7 @@ program .option('-u, --useragent [String]', 'User-Agent string', _.toString) .option('-F, --frame', 'Show window frame') .option('-s, --show', 'Show window on start') + .option('-n, --node', 'Enable node integration') .option('-i, --insecure', 'Allow insecure connections (not recommended)') .option('-v, --verbose', 'Set log level to info') .arguments('') diff --git a/lib/window.js b/lib/window.js index 73d3e2f..e9cf80a 100644 --- a/lib/window.js +++ b/lib/window.js @@ -21,6 +21,7 @@ class DisplayService extends EventEmitter2 { this.opts = _.defaultsDeep(opts || {}, { title: 'OAK', userAgent: 'Oak/' + core.version, + node: false, display: 0, width: 1024, height: 768, @@ -53,7 +54,8 @@ class DisplayService extends EventEmitter2 { this.instance = new BrowserWindow({ title: _this.opts.title, webPreferences: { - nodeIntegration: false, + nodeIntegration: _this.opts.node, + webSecurity: !_this.opts.insecure, allowDisplayingInsecureContent: _this.opts.insecure, allowRunningInsecureContent: _this.opts.insecure, preload: join(__dirname, 'preload')