Skip to content

[BUG] GM_addElement return null, when parent_node is not in document. #2729

@F9y4ng

Description

@F9y4ng

Actual Behavior

GM_addElement return null, when parent_node is not in document.

GM_addElement(Node in ShadowRoot, "img", { id: "test1", src: "abc.jpg" })
GM_addElement(Node in iframe, "img", { id: "test2", src: "abc.jpg" })

The IMG element will be inserted normally, but the element id attribute will be reset to default and the return value will be null instead of the successfully inserted element object.

Image

Expected Behavior

When parent_node is not in document, the custom attributes can be written normally and the return value is correct.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions