Execute the code after the oil monkey webpage is loaded

Principle: Listening windowevents load.

// 等待网页完成加载
window.addEventListener('load', function() {
    
    
  // 加载完成后执行的代码
}, false);

Note: It is best to put the monitoring code in the outermost layer, not in the function, so that it can be executed immediately after the page is loaded. Of course, there are special needs, adapt to the situation.

Guess you like

Origin blog.csdn.net/qq_17627195/article/details/132416561