Skip to content

[BUG] GM_xmlhttpRequest onload/onerror not triggering #549

@Coxxs

Description

@Coxxs

Problem Description

When using GM_xmlhttpRequest in ScriptCat, the onload and onerror callbacks are not triggered. The test userscript works in both Tampermonkey and Violentmonkey but not in ScriptCat.

Reproduction Steps

Test userscript:

// ==UserScript==
// @name         test
// @namespace    https://example.com/test
// @version      0.1.0
// @description  test
// @author       You
// @grant        GM_xmlhttpRequest
// @connect      www.cloudflare.com
// @connect      example.notexist
// @match        https://*/*
// ==/UserScript==

(function() {
    'use strict';

    GM_xmlhttpRequest({
        method: 'GET',
        url: "https://www.cloudflare.com/favicon.ico",
        responseType: 'blob',
        onload: function(response) {
            alert("onload - cloudflare")
        },
        onerror: function(response) {
            alert("onerror - cloudflare")
        }
    });

    GM_xmlhttpRequest({
        method: 'GET',
        url: "https://example.notexist/favicon.ico",
        responseType: 'blob',
        onload: function(response) {
            alert("onload - notexist")
        },
        onerror: function(response) {
            alert("onerror - notexist")
        }
    });

    alert("test start");
})();

Expected behavior:

test start
onerror - notexist
onload - cloudflare

Actual behavior in ScriptCat:

test start

ScriptCat Version

1.0.0.1100

Operating System and Browser Information

Windows 11 Chrome 138.0.7204.101 (x64)

Additional Information (Optional)

Affected script: Twitter View Original Images (twOpenOriginalImage) - The "download" and "zip" buttons stopped working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions