参考
油猴文档
本地开发调试设置
深入浅出 Greasemonkey 这个类似油猴,但是火狐上的,有pdf可下
跨页面传值的方式
跨页面传值-这个应该是操作storage
Userscript Header
用户脚本头,用于放在脚本开头的注释部分,代表了脚本本身的一些信息,如在哪些页面被调用,有哪些权限等
@name
The name of the script.
脚本名称
Internationalization is done by adding an appendix naming the locale.
国际化是通过添加一个命名区域的附录来完成的。(用于展示不同语言的脚本名称,见下面)
Code:
// @name A test
// @name:de Ein Test
@namespace
The namespace of the script.
脚本的命名空间
@version
The script version. This is used for the update check, in case the script is not installed from userscript.org or TM has problems to retrieve the scripts meta data.
脚本版本。用于更新检查,以防不是从userscript.org
或 TM(即 tampermonkey 油猴本身)
安装脚本的用户在检索脚本元数据时遇到问题。
@author
The scripts author.
脚本作者
@description
A short significant description.
简短而有意义的描述。
Internationalization is done by adding an appendix naming the locale.
国际化是通过添加一个命名语言环境的附录来完成的(如下:)
Code:
// @description This userscript does wonderful things
// @description:de Dieses Userscript tut wundervolle Dinge
// @description:zh 中文的描述内容
@homepage, @homepageURL, @website and @source
The authors homepage that is used at the options page to link from the scripts name to the given page. Please note that if the @namespace tag starts with \'http://\' its content will be used for this too.
用于设置访问脚本作者主页的链接,位于油猴的控制面板对应脚本的主页项。请注意,如果@namespace标记以“http://”开头,则其内容也将用于此目的。
@icon, @iconURL and @defaulticon
The script icon in low res.
低分辨率的脚本图标。
@icon64 and @icon64URL
This scripts icon in 64x64 pixels. If this tag, but @icon is given the @icon image will be scaled at some places at the options page.
此脚本图标为64x64像素。如果这个标签,但是给了 @icon ,@icon 图像将在选项页的某些地方缩放。???
@updateURL
An update URL for the userscript.
Note: a @version tag is required to make update checks work.
用户脚本的更新URL。
注意:需要 @version 标记才能进行更新检查。
@downloadURL
Defines the URL where the script will be downloaded from when an update was detected. If the value none is used, then no update check will be done.
定义检测到更新时将从中下载脚本的URL。如果使用值none,则不会执行更新检查。
@supportURL
Defines the URL where the user can report issues and get personal support.
定义用户可以在其中报告问题和获得个人支持的URL。
@include
The pages on that a script should run. Multiple tag instances are allowed.
Please note that @include doesn\'t support the URL hash parameter. You have to match the path without the hash parameter and make use of window.onurlchange
脚本应该运行的页面。允许多个标记实例。
请注意,@include不支持URL散列参数(即URL中带有md5之类的参数,用来检查URL指定的文件是否匹配)。必须匹配不带哈希参数的路径,同时要使用 window.onurlchange(监听url改变的权限,见@grant部分)
Code:
// @include http://www.tampermonkey.net/*
// @include http://*
// @include https://*
// @include /^https:\/\/www\.tampermonkey\.net\/.*$/ // @include *
@match
More or less equal to the @include tag. You can get more information here .
Note: the \'<all_urls>\' statement is not yet supported and the scheme part also accepts \'http*
相关文章
- 油猴脚本编写总结
- 【Edge浏览器】篡改猴(油猴、tempermongkey)插件的安装与使用
- 分享几款常用油猴脚本
- 油猴脚本 - Greasy Fork - 安全、有用的用户脚本大全
- 最强的浏览器插件——油猴脚本
- 【油猴脚本】00015 案例 Tampermonkey油猴脚本, 仅用于学习,不要乱搞。优化UI界面,Jquery爬虫,JavaScript爬虫,HTML+Css+JavaScript编写
- chrome内核浏览器插件的使用--Tampermonkey(油猴插件)
- Blender中脚本API的获取方法
- puppeteer学习笔记(八)--API问题解决--使用 ” evaluate “函数执行自定义js脚本
- 油猴超神好用脚本推荐