JavaScript 中 window.onback 的意外行为?

发布于 2024-07-07 15:59:56 字数 1477 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伪装你 2024-07-14 15:59:56

我没有时间(或 SharePoint07)重现您的环境和场景,但是如果您在 JavaScript 中进行位置测试会怎么样?

像这样的事情:

<script type="text/javascript">
if (window.location.indexOf("PageA.aspx", 0) > 0)
{
   window.onback = history.forward();
}
</script>

我无法解释正在发生的事情,但这应该有助于限制黑客的范围。

I don't have the time (or SharePoint07) to reproduce you environment and scenario, but what if you put a location test in the JavaScript?

Something like this:

<script type="text/javascript">
if (window.location.indexOf("PageA.aspx", 0) > 0)
{
   window.onback = history.forward();
}
</script>

I can't explain what is happening, but that should help limit the scope of the hack.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文