Skip to content

Commit

Permalink
node integration toggle, webSecurity added to insecure
Browse files Browse the repository at this point in the history
  • Loading branch information
nucleardreamer committed May 13, 2017
1 parent 1f518d2 commit 084d60f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('<url>')
Expand Down
4 changes: 3 additions & 1 deletion lib/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 084d60f

Please sign in to comment.