Skip to content

[BUG] GM_addElement Bug #1202

@cyfung1031

Description

@cyfung1031

Problem Description

// ==UserScript==
// @name         GM_addElement test
// @match        *://*/*
// @grant        GM_addElement
// ==/UserScript==

console.log('image insertion begin');

await new Promise((resolve, reject) => {
    GM_addElement(document.body, 'img', {
        src: 'https://www.tampermonkey.net/favicon.ico',
        onload: resolve,
        onerror: reject
    });

    console.log('image insertion end');
});

console.log('image loaded'); // never fired

Reproduction Steps

ScriptCat Version

1.2.x & 1.3.x

Operating System and Browser Information

Additional Information (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions