vite-plugin-monkey is a Vite plugin that compiles userscripts (user.js) for Tampermonkey, Violentmonkey, Greasemonkey, and ScriptCat. It transforms a standard Vite project into a self-contained userscript bundle, injecting the required metadata header, handling external dependencies via CDN (@require/@resource), and automatically collecting GM API grants. The plugin supports both development (HMR via a proxy server) and production builds, with dynamic import support via SystemJS. It consists of a collection of Rollup/Vite plugins that modify the build pipeline: config, CSS injection, external globals, external resources, asset URL fixing, and final bundle generation. The architecture is modular and well-separated, with clean abstractions for userscript metadata generation, AST-based grant collection, and CDN URL helpers.
ScriptCat is a sophisticated browser extension for managing userscripts with advanced AI agent capabilities. It features a multi-context architecture (content scripts, service worker, offscreen documents, popup/options UI) built with React, TypeScript, and modern web extension APIs. The extension provides userscript installation, execution, synchronization, network rule management, and an integrated AI chat interface with tool execution capabilities. Its architecture demonstrates strong separation of concerns and implements several reusable patterns for cross-context communication, storage abstraction, and caching.
This repository is a collection of Tampermonkey userscripts for Chinese cloud storage services: Baidu Pan, Aliyun/AliDrive, Quark, Tianyi/189, LanZou, Xunlei, Weiyun, Caiyun, and 123Pan. In practice, the scripts do much more than the README's vague description of "resource search": they inject download-link buttons into cloud-drive pages, resolve private API endpoints to expose direct download URLs, auto-fill share passwords from local cache or a remote LeanCloud backend, generate Aria2 RPC pushes and BitComet bc:// links, and replace native web players with APlayer/ArtPlayer-based audio/video players. The įŽĄåŽļåŠ script additionally maintains a local cache of visited share links/passwords and provides a search dialog pointing at many third-party resource-search sites.