MSCSTSTS-TOOLS

自用工具库,命名空间mscststs

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/38220/1026406/MSCSTSTS-TOOLS.js

Author
mscststs
Version
0.0.1.20220310050903
Created
2018-02-06
Updated
2022-03-10
License
N/A

自用工具库

命名空间 mscststs

  • wait方法,返回一个promise,参数为选择器。用于等待一个元素,第二参数为boolean,是否需要等待内容,默认值为false,第三个参数为查询超时时间(次数),该函数的查询频率为 100ms一次,因此第三个参数为10表示查询十次/一秒,默认值为Infinity
  • sleep方法,返回一个promise,参数为毫秒。用于等待一定的时间
  • hijackXMLHttpRequest方法,返回一个 distory 函数,第一个参数是需要劫持的 Ajax 方法,使用方式是在原方法名前面加上before或者after,即可在原方法调用时处理输入和输出