Skip to content

HVAutoAttack Fork新版本小马解谜加载刷新问题 #190

Open

Description

@GuilingQiyu

旧版在遇到战斗中验证码的时候可以直接加载出来,但是新版遇到验证码会自动刷新,导致弹窗“是否离开页面,可能有未保存的表单”,从而无法加载一些自动验证码工具

经过排查,在原版脚本中,遇到小马答题#riddlecounter,使用的是 window.location.href = window.location; ,相当于发起一次全新的 GET 请求,会直接跳过任何表单残留。

新版将全局的刷新函数改为了 window.location.reload();。当浏览器之前通过竞技场或者GF进入战斗按钮,由 POST 请求加载的页面上执行 reload() 时,会触发安全机制,弹出“确认重新提交表单”或“可能未保存”的警告框。这个警告框会阻塞 JavaScript 的主线程,导致自动验证码脚本无法加载。

我个人目前的相关解决方法(patch1):

//812行
    function goto() { // 前进
      window.location.href = window.location.search ? window.location.pathname + window.location.search : window.location.href; //回归原设计,采用GET 请求防止表单弹窗
      setTimeout(goto, 5000);
    }

一定程度上可供参考

Activity

  1. changed the title [-]Fork新版本小马解谜加载刷新问题[/-] [+]HVAutoAttack Fork新版本小马解谜加载刷新问题[/+] on Apr 18, 2026
  2. WayneFerdon commented on Apr 18, 2026

    @WayneFerdon
    Contributor

    @GuilingQiyu 2.90.178 先按上面的改了
    之前改成reload好像是有什么原因的,但是没写注释忘了(
    不过应该问题不大,再出问题再说
    另外,5025行也有一个window.location.reload();的刷新,也改了,虽然实际很少见这个触发

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions