Greasy Fork

libs

JavaScript 库函数,以便调用

目前为 2024-04-08 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.icu/scripts/491971/1356534/libs.js

作者
Essence
版本
0.1
创建于
2024-04-08
更新于
2024-04-08
大小
1.4 KB
许可证
暂无

库函数

使用

sleep

等待毫秒数

await sleep(3000)

waitElem

  const click = (elem) => {
    console.log(TAG, "人机验证的选择框", elem)
    elem.click()
  }

  waitElem("div#challenge-stage span.mark", click)

readLocalStorageValues

const history = readLocalStorageValues(/^Hm_lvt/)

restoreLocalStorageValues

const json = `{"a": 123, "b": "test"}`
restoreLocalStorageValues(json)