我如何<iframe> Gmail?

Nic*_*las 16 iframe gmail google-chrome

我知道Gmail可能会采取一些安全措施来防止这种情况发生,但我确实需要将Gmail放在一个元素中.

以下两种方法不起作用:

<object type='text/html' data='http://mail.google.com/'></object>

<iframe src='http://mail.google.com/' frameborder=0 style='width:322px; height:480px;'></iframe>
Run Code Online (Sandbox Code Playgroud)

还有其他方法吗?

tjv*_*jvr 21

你不能.与Google的大多数其他网络服务一样,GMail会设置HTTP标头:

X-Frame-Options: SAMEORIGIN
Run Code Online (Sandbox Code Playgroud)

不允许他们的网站被GMail本身以外的任何网站诬陷.


Chr*_*ris 7

您最好使用Google API. http://code.google.com/appengine/docs/python/mail/

虽然不是你问题的解决方案,但我相信这是一个合适的选择.