Is there a client-side way to detect X-Frame-Options?

后端 未结 8 716
温柔的废话
温柔的废话 2020-12-28 12:16

Is there any good way to detect when a page isn\'t going to display in a frame because of the X-Frame-Options header? I know I can request the page serverside and look for

8条回答
  •  既然无缘
    2020-12-28 12:45

    The only thing I can think of is to proxy an AJAX request for the url, then look at the headers, and if it doesn't have X-Frame-Options, then show it in the iframe. Far from ideal, but better than nothing.

提交回复
热议问题