forked from nwjs/nw.js
-
Notifications
You must be signed in to change notification settings - Fork 2
Security
rogerwang edited this page Apr 14, 2013
·
14 revisions
node-webkit adds Node.js support and enhancement in DOM for trusted code and content. For untrusted code and content, it should remain in a normal frame or iframe, which is the same as the one in browser. So there are 2 kinds of frames in node-webkit: Node frame and normal frame.
As application developer, one should be keep in mind that contents should be loaded in correct frames.
Which frames are Node frames and which are not?
- iframes has the attribute
nwdisableare normal frames. - Local file, or remote URL matches the
node-remotefield. (nodejsfield should not be set to false in this case) - Frames opened with
window.openare normal frames when these flags are set:new-instance=trueandnodejs=false
What can Node frames do?
- Node support: access to
require,global,process,Bufferandrootfrom Node. - Universal access to other frames: this can get around all cross-domain security checks defined in DOM.
- Ignore
X-Frame-Optionsheaders for child frames.
nwdisable is added in 0.5.0 rc2