]> khamidou — GitHub mirrors - electron.git/commitdiff
docs: Add document on overriding X-Frame-Options.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 11 Aug 2014 07:25:26 +0000 (15:25 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 11 Aug 2014 07:25:26 +0000 (15:25 +0800)
atom/browser/default_app/index.html
docs/api/browser-window.md
docs/api/web-security.md [new file with mode: 0644]

index 1a689d8a6b3361c9b5af511a90aa3461cb8f9beb..df6001242836acc312c37ec34c3139043726216e 100644 (file)
@@ -62,8 +62,6 @@
   </style>
 </head>
 <body>
-  <iframe src="http://google.com"></iframe>
-  <iframe src="http://baidu.com"></iframe>
   <script>
     var execPath = require('remote').process.execPath;
     var command = execPath + ' path-to-your-app';
index be6357eb9ef930b78e24f127adcd04659a3dcb5d..0e75e86a51ff454a95106cc02f4f919cee169b0f 100644 (file)
@@ -18,6 +18,9 @@ win.show();
 You can also create a window without chrome by using
 [Frameless Window](frameless-window.md) API.
 
+Security strategy of web pages showed by `BrowserWindow` is a bit different from
+normal browsers, see [Web Security](web-security.md) for more.
+
 ## Class: BrowserWindow
 
 `BrowserWindow` is an
diff --git a/docs/api/web-security.md b/docs/api/web-security.md
new file mode 100644 (file)
index 0000000..8143e5f
--- /dev/null
@@ -0,0 +1,21 @@
+# Web Security
+
+Because atom-shell has added node integration to normal web pages, there are
+some security adjustments that made atom-shell both more safe and more
+convenient.
+
+## Overriding `X-Frame-Options` header
+
+May websites (including Google and Youtube) use the
+[X-Frame-Options](x-frame-options) header to disable access to their websites
+in `iframe`s. In atom-shell you can add a `disable-x-frame-options` string in
+the `iframe`'s name to disable this:
+
+```html
+<!-- Refused to display -->
+<iframe name="google" src="https://google.com"></iframe>
+<!-- Loads as expected -->
+<iframe name="google-disable-x-frame-options" src="https://google.com"></iframe>
+```
+
+[x-frame-options](https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options)