QOS-Handler

QOS-Handler(window param ver)

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/430297/1128326/QOS-Handler.js

Author
CosilC
Version
0.2
Created
2021-08-03
Updated
2022-12-14
License
GPL

用途:流量控制

说明:载入时赋值到window.qos内,包含三个方法

record(sec, timesLimit)

  • 描述:记录这次的访问时间戳,并返回是否超出限制
  • 参数:
    • sec 时间限制
    • @param timesLimit 次数限制
  • 返回:sec秒内访问了超过timesLimit次 ? true : false

clearRecord()

  • 描述:清除缓存中的记录

getRecord()

  • 描述:获取记录的历史
  • 返回:历史记录数组