开发者

Why don't Google Group pages load in a WebKit Iframe?

In Chrome and Safari, the following loads as a blank frame.

<html>
  <head>
    <title>Iframe Test</title>
  &开发者_Python百科lt;/head>
  <body>
    <iframe src="http://groups.google.com/group/websync"></iframe>
  </body>
</html>

Yet the direct URL works fine. What gives?


Its not a Chrome/WebKit issue. Infact its a Firefox issue.

Try the following, Chrome will load the iframe

<html>
  <head>
    <title>Iframe Test</title>
  </head>
  <body>
    <iframe src="http://groups.google.com/"></iframe>
  </body>
</html>

What is happening is, when you requrest for the webpage groups.google.com/group/websync google web server is setting HTTP header

X-Frame-Options: SAMEORIGIN

When X-Frame-Options: is set to SAMEORIGIN, the browser suppose to only allow the content to be framed by pages within the same origin domain, i.e unless your page is coming from google.com, browser is not suppose to let you frame the content of http://groups.google.com/group/websync.

WebKit is doing a better job.


It works fine in Firefox, although I had to bump the width/height values to make it readable.

Environment: Ubuntu 9.04 server, Apache 2.2.11, FF 3.5.6

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜