tampermonkey参数
@name
脚本的名称
@namespace
该脚本的命名空间
@version
版本号。当脚本未从 userscript.org安装时用于更新检查,或 Tampermonkey 有问题时检索脚本元数据的。
@author
作者
@description
简介与描述
@match
等于@include标签,详情点击http://code.google.com/chrome/extensions/match_patterns.html。
注意:"<all_urls>"语句尚不支持,scheme部分也接受"http*://"。
@grant
@grant 用于添加GM_ 函数到白名单,例如unsafeWindow对象和一些强大的window函数。如果没有给出@grant标签Tampermonkey会猜测脚本需要。
Code:
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_setClipboard
// @grant unsafeWindow
// @grant window.close
// @grant window.focus
另外window.close和window.focus必须显式声明。
如果使用// @grant none,沙箱将被禁用,脚本将直接在页面上下文中运行。在此模式下,没有GM_ 函数,但GM_info属性仍然可用。
Code:
// @grant none