Two understandings of monkey oil writing code

Two understandings of monkey oil tampermonkey writing code:

1. It is really inconvenient to write js code on monkey oil, it is recommended to use vscode to write.

The specific way:

​ 1. Copy the content of the script created in js to vscode,

​ 2. Encode in vscode

​ 3. Copy the vscode code into the newly created script of js.

Summary : This can only be done, I can't find other methods for the time being. I have found a way to use @require. After practice, I found that the requirements cannot be achieved. The reasons are as follows: @require's work points to load and execute before the script itself starts running The JavaScript file is also run before the html loads the object. So it is possible to refer to the tool class js like js, but if you want to operate on the object in the html, you will not get the object. My experience is that a bunch of Null flew in the air.

2. Understanding of the order of execution of statements on monkey oil:

  1. The js script introduced using @require is run before the html loads the object
  2. The js code on the script is run after the html is loaded.

Guess you like

Origin blog.csdn.net/weixin_44767679/article/details/110478229