我需要绕过或破坏一个frame buster,但是我没有一个返回204的服务器。到目前为止,有效的最佳解决方案是第4页C部分onBeforeUnload - 204刷新中的https://crypto.stanford.edu/~dabo/pubs/papers/framebust.pdf中的解决方案。
在此处(Frame buster buster)和此处(Frame Buster Buster ... buster code needed)进行了讨论,代码如下所示
<script type="text/javascript">
var prevent_bust = 0
window.onbeforeunload = function() { prevent_bust++ }
setInterval(function() {
if (prevent_bust > 0) {
prevent_bust -= 2
window.top.location = 'http://example.org/page-which-responds-with-204'
}
}, 1)
</script>我的问题是,我没有一个返回HTTP状态码204的服务器(并且我不能设置一个)。我该如何解决这个问题呢?
发布于 2018-09-16 19:06:55
由于您不能设置自己的服务器,因此除了使用第三方服务器之外,您没有太多的选择。明显的缺点是它不在你的控制之下,所以你不能控制它的可用性。
以返回各种HTTP状态代码为目的的服务器可能更可靠(而不是寻找随机的东西)。您可以使用httpstat.us。主页列出了它支持的所有状态代码和选项。下面将返回HTTP204:httpstat.us/204。
https://stackoverflow.com/questions/48614873
复制相似问题