Skip to content

[BUG] 未与 TM 对齐: DOMPraser 失败时 responseXML 应设为 null 而非 crash #1240

@cyfung1031

Description

@cyfung1031

Problem Description

  • https://docs.google.com/forms/d/e/1FAIpQLSeAGfm0UUoQbBQnGR1fT8YcXJZvxaSYJTHUY_SqFt295RVVCA/viewform?testing_DOMPraser
// ==UserScript==
// @name         GM_XHR Example
// @grant        GM.xmlHttpRequest
// @match        *://*/*?testing_DOMPraser
// @connect httpbin.org
// ==/UserScript==

(async () => {
  try {
    const response = await GM.xmlHttpRequest({
      method: "GET",
      url: "https://httpbin.org/get",
      headers: {
        "Accept": "application/json"
      },
      onload: (res) => {
          console.log("responseXML", res.responseXML);
        console.log("Status:", res.status);
        console.log("Response:", res.responseText);
      }
    });
  } catch (e) {
    console.error("Request failed", e);
  }
})();

Reproduction Steps

ScriptCat Version

Operating System and Browser Information

Additional Information (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibility其它管理器可以运行,脚本猫不能运行

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions