Token导航 LogoToken导航TokenDH.com
AI 工具操作浏览器github未标认证来源可访问clear审计提醒

tampermonkeytampermonkey 命令行

Agent Skill

tampermonkey 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,160

周安装

90

GitHub Stars

52

下载量

720
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tampermonkey(tampermonkey 命令行)
来源仓库:https://github.com/henkisdabro/wookstar-claude-code-plugins
仓库路径:skills/tampermonkey
安装命令:
npx skills add https://github.com/henkisdabro/wookstar-claude-code-plugins --skill tampermonkey
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/henkisdabro/wookstar-claude-code-plugins --skill tampermonkey

简介

tampermonkey 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前需确认权限范围、维护状态,以及是否触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Tampermonkey Userscript Development

Expert guidance for writing Tampermonkey userscripts - browser scripts that modify web pages, automate tasks, and enhance browsing experience.

Quick Start Template

**JavaScript (simple scripts with no GM.* APIs)**

// ==UserScript==
// @name         My Script Name                    // <- CUSTOMISE: Unique script name
// @namespace    https://example.com/scripts/      // <- CUSTOMISE: Your unique namespace
// @version      1.0.0                             // <- INCREMENT on updates
// @description  Brief description of the script   // <- CUSTOMISE: What it does
// @author       Your Name                         // <- CUSTOMISE: Your name
// @match        https://example.com/*             // <- CUSTOMISE: Target URL pattern
// @grant        none                              // <- ADD permissions as needed
// @run-at       document-idle                     // <- ADJUST timing if needed
// ==/UserScript==

(function() {
    'use strict';
    // Your code here
})();

**Modern (async/await - recommended when using GM.* APIs)**

// ==UserScript==
// @name         My Script Name
// @namespace    https://example.com/scripts/
// @version      1.0.0
// @description  Brief description of the script
// @author       Your Name
// @match        https://example.com/*
// @grant        GM.getValue
// @grant        GM.setValue
// @run-at       document-idle
// ==/UserScript==

(async () => {
    'use strict';
    // Async entry point — use await with GM.* APIs
    const setting = await GM.getValue('myKey', 'default');
    console.log('Script loaded, setting:', setting);
})();

TypeScript: Add @types/tampermonkey for full type safety. See typescript.md.


Essential Header Tags

TagRequiredPurposeExample
@nameYesScript name (supports i18n with :locale)@name My Script
@namespaceRecommendedUnique identifier namespace@namespace https://yoursite.com/
@versionYes*Version for updates (*required for auto-update)@version 1.2.3
@descriptionRecommendedWhat the script does@description Enhances page layout
@matchYes**URLs to run on (**or @include)@match https://example.com/*
@grantSituationalAPI permissions (use none for no GM_* APIs)@grant GM_setValue
@run-atOptionalWhen to inject (default: document-idle)@run-at document-start
@run-inOptionalLimit to normal or incognito tabs, or Firefox containers (v5.3+)@run-in normal-tabs

For complete header documentation, see: header-reference.md


URL Matching Quick Reference

// Exact domain                  // @match https://example.com/*
// All subdomains                // @match https://*.example.com/*
// HTTP and HTTPS                // @match *://example.com/*
// Exclude paths (with @match)   // @exclude https://example.com/admin/*

For advanced patterns (regex, @include, specific paths), see: url-matching.md


@grant Permissions Quick Reference

You Need To...Grant This
Store persistent data@grant GM_setValue + @grant GM_getValue
Make cross-origin requests@grant GM_xmlhttpRequest + @connect domain
Add custom CSS@grant GM_addStyle
Access page's window@grant unsafeWindow
Show notifications@grant GM_notification
Add menu commands@grant GM_registerMenuCommand
Detect URL changes (SPA)@grant window.onurlchange
Batch read/write settings (v5.3+)@grant GM.getValues + @grant GM.setValues
Mute/unmute tab audio@grant GM_audio
// Disable sandbox (no GM_* except GM_info)
// @grant none

// Cross-origin requests require @connect
// @grant GM_xmlhttpRequest
// @connect api.example.com
// @connect *.googleapis.com

For complete permissions guide, see: header-reference.md


@run-at Injection Timing

ValueWhen Script RunsUse Case
document-startBefore DOM existsBlock resources, modify globals early
document-bodyWhen body existsEarly DOM manipulation
document-endAt DOMContentLoadedMost scripts - DOM ready
document-idleAfter DOMContentLoaded (default)Safe default
context-menuOn right-click menuUser-triggered actions

Common Patterns

These patterns are used frequently. Brief summaries are below - load patterns.md for full implementations with code examples.

  • Wait for Element - Promise-based MutationObserver that resolves when a CSS selector appears in the DOM, with configurable timeout
  • SPA URL Change Detection - Detect navigation in single-page apps using window.onurlchange grant or History API interception
  • Cross-Origin Request - Fetch data from external APIs using GM_xmlhttpRequest with @connect domain whitelisting. See also http-requests.md
  • Add Custom Styles - Inject CSS with GM_addStyle to restyle pages or hide elements. See also api-dom-ui.md
  • Persistent Settings - Store user preferences with GM_setValue/GM_getValue and expose toggle via GM_registerMenuCommand. See also api-storage.md
  • DOM Mutation Observation - Watch for dynamically added content with MutationObserver (debounced variant included)
  • Element Manipulation - Inject HTML, remove/hide elements, replace text across the page
  • Keyboard Shortcuts - Simple handlers and a shortcut manager with modifier key support
  • Data Extraction - Extract table data to arrays/objects, collect and filter page links
  • Error Handling - Safe wrapper for try/catch and async retry with exponential backoff
  • TypeScript Userscripts - Type-safe scripts with @types/tampermonkey. See typescript.md

External Resources

// @require - Load external scripts
// @require https://code.jquery.com/jquery-3.6.0.min.js#sha256-/xUj+3OJU...
// @require tampermonkey://vendor/jquery.js         // Built-in library

// @resource - Preload and inject external CSS
// @resource myCSS https://example.com/style.css    // Then: GM_addStyle(GM_getResourceText('myCSS'))
// @grant GM_getResourceText
// @grant GM_addStyle

TypeScript Support

Install the type definitions for full IDE autocompletion and type safety:

npm install --save-dev @types/tampermonkey
// ==UserScript==
// @name         My TypeScript Script
// @match        https://example.com/*
// @grant        GM.getValue
// @grant        GM.xmlHttpRequest
// @connect      api.example.com
// ==/UserScript==

(async () => {
    'use strict';
    const value = await GM.getValue<string>('key', 'default');
    const info: Tampermonkey.ScriptInfo = GM_info;
    console.log(info.script.name, value);
})();

Build with a bundler (esbuild, Vite, webpack) to a single .user.js output file. For full project setup including tsconfig and bundler config, see typescript.md.


What Tampermonkey Cannot Do

Userscripts have limitations:

  • Access local files - Cannot read/write files on your computer
  • Run before page scripts - In isolated sandbox mode, page scripts run first
  • Access cross-origin iframes - Browser security prevents this
  • Persist across machines - GM storage is local to each browser
  • Bypass all CSP - Some very strict CSP cannot be bypassed
  • Inject without permission - Tampermonkey v5.4.1+ requires users to grant injection permission per-site or globally; scripts cannot bypass this requirement

Most limitations have workarounds - see common-pitfalls.md.


When Generating Userscripts

Always include in your response:

  1. Explanation - What the script does (1-2 sentences)
  2. Complete userscript - Full code with all headers in a code block
  3. Installation - "Copy/paste into Tampermonkey dashboard" or "Save as.user.js"
  4. Customisation points - What the user can safely modify (selectors, timeouts, etc.)
  5. Permissions used - Which @grants and why they're needed
  6. Browser support - If Chrome-only, Firefox-only, or universal

Pre-Delivery Checklist

Before returning a userscript, verify:

Critical (Must Pass)

  • No hardcoded API keys, tokens, or passwords
  • @match is specific (not *://*/*)
  • All external URLs use HTTPS
  • User input sanitised before DOM insertion

Important (Should Pass)

  • Wrapped in IIFE with 'use strict'
  • All @grant statements are necessary
  • @connect includes all external domains
  • Error handling for async operations
  • Null checks before DOM manipulation

Recommended

  • @version follows semantic versioning (X.Y.Z)
  • Works in both Chrome and Firefox
  • Comments explain non-obvious code

For complete security checklist, see: security-checklist.md


Reference Files Guide

Load these on-demand based on user needs:

FileWhen to Load
Core
header-reference.mdHeader syntax - all @tags with examples
url-matching.md@match, @include, @exclude patterns
patterns.mdCommon implementation patterns with code
sandbox-modes.mdSecurity/isolation execution contexts
API
api-sync.mdGM_* synchronous function reference (callback-based)
api-async.mdGM.* promise-based API reference - prefer these for new scripts
api-storage.mdGM_setValue, GM_getValue, listeners
http-requests.mdGM_xmlhttpRequest cross-origin
web-requests.mdGM_webRequest interception (Firefox)
api-cookies.mdGM_cookie manipulation
api-dom-ui.mdaddElement, addStyle, unsafeWindow
api-tabs.mdgetTab, saveTab, openInTab
api-audio.mdMute/unmute tabs
Quality
common-pitfalls.mdWhat breaks scripts and workarounds
debugging.mdHow to debug userscripts
browser-compatibility.mdChrome vs Firefox differences
security-checklist.mdPre-delivery security validation
version-numbering.mdVersion string comparison rules
typescript.mdTypeScript project setup with @types/tampermonkey, bundler config

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.92%
按下载量换算223

OpenCode

25.18%
按下载量换算181

Cursor

17.21%
按下载量换算124

openclaw

12.69%
按下载量换算91

Gemini CLI

7.52%
按下载量换算54

Antigravity

3.35%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills