Skip to content

setTimeout() / setInterval() don't seem to be working #3

@tao-oat

Description

@tao-oat

Hello,
I'm trying to run a script on a page that loads dynamically(?), so I have to wait quite a while for the element I want to be present.
Using setTimeout() or setInterval() has no effect whatsoever, as the script action runs instantly, regardless of the value I put in the timeout:
setTimeout(remove_elements('._3z9_h'), 5000);
or
setInterval(remove_elements('._3z9_h'), 5000);

Using the "load" event seems to delay it a bit, but it's not enough, as the page is only halfway through when it runs:
window.addEventListener('load', remove_elements('._3z9_h'));

Is it a bug or am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions