How can I get greasemonkey to call a function on a page after it loads

前端 未结 3 1952
天涯浪人
天涯浪人 2021-01-31 17:51

I have a very simple greasemonkey script that I want to call an already existing javascript function on the page. I\'ve read the documentation and nothing seems to work

3条回答
  •  迷失自我
    2021-01-31 18:18

    You could try using javascript event listeners.

    These execute code on response to object events occurring (such as page load)

    For example, to execute code on page load:

    window.addEventListener('load', function () 
    {
        /* code goes here */
    }
    

提交回复
热议问题