Run Greasemonkey script on the same page, multiple times?

前端 未结 2 1729
一生所求
一生所求 2020-11-22 06:00

I\'m totally new to Greasemonkey, javascript, in fact all the UI stuff.

Requirement: Userscript is run by GS once after the page loads. However, I need the same scr

2条回答
  •  野性不改
    2020-11-22 06:36

    You can use the DOMNodeInserted event to call your callback, e.g.:

    document.addEventListener('DOMNodeInserted', function() { alert('hi') }, false);
    

    Note that the event will be triggered by any change in the page structure, so you'll have to check that you're targeting the right change.

提交回复
热议问题