@yiero/gmlib
TypeScript icon, indicating that this package has built-in type declarations

0.1.13 • Public • Published

油猴辅助函数库

一系列辅助油猴脚本开发的函数.

函数库

Page

页面 载入 / 刷新 相关

函数 作用 示例 需要授权函数
elementWaiter 等待元素载入 elementWaiter.js -

API

网络请求 相关

函数 作用 示例 需要授权函数
getCookie 获取对应网站 Cookie getCookie.js GM_cookie
GM_info
gmRequest 通过 GM_xmlhttpRequest 发送网络请求 (Promise). gmRequest.js GM_xmlhttpRequest
hookXhr 用于劫持 xhr 请求, 获取其返回内容, 并篡改返回内容 hookXhr.js -

Env

脚本环境 相关

函数 作用 示例 需要授权函数
isIframe 判断脚本载入页面是否为 Iframe 页面 isIframe.js -
environmentTest 输出当前脚本的安装环境 (ScriptCat / TamperMonkey) environmentTest.js GM_info

UI

UI 相关

函数 作用 示例 需要授权函数
uiImporter 传入 html 文本和 css 文本, 自动解析并载入页面 uiImporter.js GM_addStyle

Element

页面 元素 相关

函数 作用 示例 需要授权函数
scroll 滚动页面到指定元素位置/指定位置 scroll.js -

Storage

页面 存储 相关

函数 作用 示例 需要授权函数
GmStorage 管理 GmStorage 存储 类 GmStorage.js GM_getValue
GM_setValue
GM_deleteValue
GM_addValueChangeListener
GM_removeValueChangeListener
GmArrayStorage 管理 GmStorage 数组存储类, 为 GmStorage 的子类 GmArrayStorage.js GM_getValue
GM_setValue
GM_deleteValue
GM_addValueChangeListener
GM_removeValueChangeListener

Package Sidebar

Install

npm i @yiero/gmlib

Weekly Downloads

7

Version

0.1.13

License

MIT

Unpacked Size

32.4 kB

Total Files

28

Last publish

Collaborators

  • yiero