6

I'm writing a chrome extension that like intab loads links in an inline iframe, it works great except for sites that set the X-Frame-Options header to DENY or SAMEORIGIN.

In this Question a working solution provided for the case where the HTTP header contains X-Frame-Options property. But, X-Frame-Options can also be set in a element in the HTML .

Is there a way to remove this element before it's being loaded by chrome?

4

1 回答 1

0

<meta name="X-frame-options"/>

没有这样的事情<meta name="X-Frame-Options">
而且,在 chrome 加载之前操作 DOM 也是不可能的。
Chrome 加载一个页面,然后创建 dom。

但那是什么x-frame-options

X-frame-options 是服务器端设置的 http 标头。
它们是安全保护的一部分(例如针对点击劫持)。Chrome 或任何其他浏览器不会让您忽略/更改它。时期。
旁注:如果是您的网站,您可以更改每个 PHP 的 x-frame-options。
旁注#2:唯一的方法是XSS。我很确定你不想那样做。

于 2013-04-28T16:15:36.287 回答