Modifying X-Frame Options on an IFRAME through Nod

2019-05-09 17:35发布

问题:

Is it possible to modify the Response Headers for an IFRAME in a Node.JS application?

Do you have to create a proxy first? ( Something similar to this? http://www.bennadel.com/blog/2179-Extending-EventEmitter-In-Order-To-Create-A-Response-Proxy-In-Node-js.htm )

I basically want to be able to show the mobile version of Gmail within an IFRAME.

回答1:

In general the answer is yes, you would have to proxy it. However in this particular case, that may not even work - Google seems to have deployed additional counter-measures to block logging-in via proxies. (If you're proxying the request, then you can see the users password, read their email, etc.)

If you only need to read your own email, then you have an alternate option: https://USERNAME:PASSWORD@gmail.google.com/gmail/feed/atom will give you an RSS feed of recent emails. This also has the x-frame-options: SAMEORIGIN header, but you can proxy it through node.