Skip to content

Commit 02ec5c3

Browse files
committed
ScriptVault v1.6.0: major feature release with 40+ enhancements
Script management: 6 templates, version rollback (3 history), script folders, script pinning, script notes, tag filtering, batch URL install, Tampermonkey backup import, drag-drop install, shift+click multi-select Editor: comment toggle, word wrap, snippet insert (7 templates), Ctrl+/ shortcut, CDN library browser (cdnjs), enhanced linter (duplicate/broad/missing detection), autocomplete snippets for GM APIs Dashboard: command palette (Ctrl+K), advanced search filters (10 types), full-text code search, column visibility toggle, activity log, keyboard shortcuts (Ctrl+N/I/W, Alt+1-5, Ctrl+Tab), @match pattern tester, script health indicators, performance budgets, storage quota monitor, author display, description tooltips Security: static analysis engine (28 patterns, 7 categories, risk scoring), network request logging with HAR export, force-update (bypass cache) Organization: script folders with collapsible groups, workspaces (named enable/disable snapshots), copy install URL, version diff view Install page: 16 improvements including @connect/@antifeature/@run-at display, version downgrade detection, inline errors, CodeMirror theme matching, keyboard shortcuts, security analysis integration Popup: branding, URL bar, total script count, contextual empty state, error dots, stagger animation, name click opens editor, Copy URL + Pin actions Search: OpenUserJS embedded API search, duplicate detection badges, GreasyFork contextual search Bug fixes: NetworkLog duration NaN, dashboard state initialization, command palette help tab routing New modules: bg/analyzer.js, bg/netlog.js, bg/workspaces.js, FolderStorage
1 parent b33b350 commit 02ec5c3

21 files changed

+4702
-204
lines changed

CLAUDE.md

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Modern userscript manager built with Chrome Manifest V3. Tampermonkey-inspired functionality with cloud sync, auto-updates, and a full dashboard.
55

66
## Version
7-
v1.5.2
7+
v1.6.0
88

99
## Tech Stack
1010
- Chrome MV3 extension (JavaScript)
@@ -23,17 +23,20 @@ v1.5.2
2323

2424
## Key Files
2525
- `manifest.json` - Extension manifest (version source of truth)
26-
- `background.core.js` - Main service worker logic (~4220 lines)
27-
- `modules/storage.js` - SettingsManager, ScriptStorage, ScriptValues, TabStorage
26+
- `background.core.js` - Main service worker logic (~4850 lines)
27+
- `bg/analyzer.js` - Static analysis engine (28 pattern detectors, risk scoring)
28+
- `bg/netlog.js` - Network request logger (GM_xmlhttpRequest interception)
29+
- `bg/workspaces.js` - Workspace manager (named script state snapshots)
30+
- `modules/storage.js` - SettingsManager, ScriptStorage, ScriptValues, TabStorage, FolderStorage
2831
- `modules/sync-providers.js` - CloudSyncProviders (WebDAV, Google Drive, Dropbox, OneDrive)
2932
- `modules/resources.js` - ResourceCache for @resource/@require
3033
- `modules/xhr.js` - XhrManager for GM_xmlhttpRequest abort tracking
3134
- `modules/i18n.js` - I18n module with inline translations
3235
- `shared/utils.js` - escapeHtml, generateId, sanitizeUrl, formatBytes
3336
- `content.js` - Content script bridge (ISOLATED world <-> USER_SCRIPT world)
34-
- `pages/popup.js` - Browser action popup
35-
- `pages/dashboard.js` - Full dashboard (scripts list, editor, settings, values editor, help)
36-
- `pages/install.js` - Userscript install confirmation page
37+
- `pages/popup.js` - Browser action popup (~710 lines)
38+
- `pages/dashboard.js` - Full dashboard (~4900 lines)
39+
- `pages/install.js` - Userscript install confirmation page (~790 lines)
3740
- `lib/fflate.js` - ZIP compression library
3841

3942
## Architecture
@@ -72,3 +75,56 @@ v1.5.2
7275
- Script conflict detection: `findConflictingScripts()` compares @match/@include patterns across all scripts
7376
- Info panel shows full perf stats (runs, avg/total time, errors, last URL) with Reset Stats button
7477
- Popup shows color-coded execution time badges (green <50ms, yellow <200ms, red 200ms+)
78+
- Script templates: 6 templates in `SCRIPT_TEMPLATES` object in dashboard.js (blank, page modifier, CSS injector, API interceptor, SPA script, cross-site request)
79+
- Version history: `script.versionHistory` array (max 3 entries), auto-saved on `UpdateSystem.applyUpdate()`. Rollback via `rollbackScript` message handler
80+
- Storage quota monitor: `updateStats()` renders quota bar + warning toast at 85% of 10MB Chrome limit
81+
- `getVersionHistory` and `rollbackScript` message handlers in background.core.js
82+
- Tag filtering: dynamic `@tag` options in filter dropdown, `getFilteredScripts()` supports `tag:` prefix filters
83+
- Drag-and-drop file install: drop .user.js or .zip files onto dashboard body to install. `showDropOverlay()` for visual feedback
84+
- Shift+click multi-select: checkbox click handler supports Shift key for range selection via `state._lastCheckedId`
85+
- @require library browser: cdnjs API search in Externals panel. Inserts `@require` before `==/UserScript==` in editor
86+
- GM_audio.addStateChangeListener/removeStateChangeListener: background watches via `chrome.tabs.onUpdated` for `audible`/`mutedInfo` changes, forwards via `audioStateChanged` message through content script bridge
87+
- Linter enhancements: duplicate @match, duplicate @grant, duplicate @require detection; broad match pattern warnings; missing @version/@description info hints
88+
- Autocomplete snippets: GM_xmlhttpRequest, GM_notification, GM_download insert full code templates with [snippet] suffix; added missing grant values (window.close/focus/onurlchange, GM_audio, GM_addElement, etc.)
89+
- Force-update: right-click update button bypasses HTTP cache (Cache-Control: no-cache). `forceUpdate` message handler in background.core.js
90+
- Script stats export: `exportStatsCSV()` function, Export CSV button in Utilities panel
91+
- Popup enhancements: description tooltip on script items, not-running opacity indicator for disabled scripts
92+
- Dashboard keyboard shortcuts: Ctrl+N (new), Ctrl+I (import), Alt+1-5 (tab switch), Ctrl+W (close tab), Ctrl+Tab (cycle tabs), Ctrl+/ (focus search)
93+
- Advanced search filters: filter by errors, update URL, grant type (xhr/storage/style/none), scope (broad/single-site), plus tag filters
94+
- Editor toolbar: comment toggle (//) button, word wrap toggle, snippet insert dropdown (7 snippets)
95+
- OpenUserJS embedded search: API-based in-dashboard results (falls back to external if API unavailable)
96+
- Help panel: Getting Started guide, Dashboard Shortcuts section, GM API Quick Reference (4 categories)
97+
- Batch URL install: paste multiple URLs (one per line) to install in sequence, with progress
98+
- Script notes: personal notes textarea per-script, saved in script.settings.notes
99+
- Script diff view: line-by-line diff modal comparing version history entries vs current code, with add/delete/context coloring
100+
- Author display: shows @author under script name in table rows
101+
- Description tooltip: hovering script name in table shows @description
102+
- Editor Ctrl+/ shortcut mapped to comment toggle button
103+
- Version diff button: "Diff" button alongside "Rollback" in version history
104+
- Script pinning: star button in action icons, pinned scripts sort to top via stable sort. Persisted as settings.pinned
105+
- @match pattern tester: test any URL against all installed scripts, shows matching + disabled state, in Help panel
106+
- Activity log: all toast messages logged to Activity Log section in Utilities, timestamped, capped at 50 entries
107+
- Script health indicators: rows with errors get red left border, stale scripts (>180 days) get yellow border
108+
- Tampermonkey backup import: `importTampermonkeyBackup` message handler parses .txt format with multiple scripts separated by blank lines
109+
- Full-text code search: prefix search with `code:` to search inside script source code, also searches author field
110+
- Duplicate detection in Find Scripts: installed badge + green border on already-installed scripts, Install button shows "Reinstall"
111+
- Column visibility toggle: modal with checkboxes for 8 toggleable columns, persisted in settings._hiddenColumns, applied via applyColumnVisibility()
112+
- Copy install URL: clipboard copy button in script row actions (only shown when downloadURL/updateURL exists)
113+
- Install page audit (16 fixes): script size/line count display, @connect domains section, @antifeature warnings, @run-at/noframes display, version downgrade warning, inline install errors (no more alert()), large script warning (>500KB), success page shows "Open in Dashboard" button with 5s auto-close, proper extension icon instead of emoji, entrance animation, keyboard shortcuts (Enter=install, Escape=cancel), CodeMirror theme matches catppuccin/oled, @tag display, resource tooltips, show 8 URL patterns (was 5)
114+
- Popup audit (12 fixes): ScriptVault branding in header, URL bar showing current hostname, total script count in footer, contextual empty state with GreasyFork link, error dots on scripts with errors, stagger animation on script items, click name opens editor (not toggle), dropdown adds Copy URL + Pin/Unpin actions
115+
- Command Palette: Ctrl+K opens fuzzy-search command palette. Actions, navigation, settings, and all installed scripts searchable. Arrow keys + Enter navigation. Grouped by category.
116+
- Static Analysis Engine: bg/analyzer.js with 28 pattern detectors across 7 categories (execution, data, network, fingerprint, obfuscation, mining, hijack). Risk score 0-100. Runs on install page with color-coded results. High-entropy string detection.
117+
- Script Folders: FolderStorage module in storage.js. CRUD operations. Drag scripts into folders. Collapsible folder headers in table. Folder color dots. "New Folder" button in toolbar. "Move to Folder" in script actions. Folder delete with confirmation.
118+
- Build system: bg/ directory auto-included in build-background.sh
119+
- Network Request Log (Phase 3C): bg/netlog.js logs all GM_xmlhttpRequest calls. Stores method, URL, status, duration, response size, script name. getNetworkLog/clearNetworkLog message handlers. Dashboard UI with stats bar + scrollable log. HAR export.
120+
- Workspaces (Phase 4B): bg/workspaces.js manages named snapshots of enabled/disabled script states. Create/activate/save/delete. Dashboard UI with workspace list + switch/save/delete buttons. Activating a workspace re-registers all scripts.
121+
- Performance Budgets (Phase 5B): configurable default budget (ms) in settings. Per-script budget override. Scripts exceeding budget get purple right border (row-over-budget). Budget setting UI in Utilities panel.
122+
123+
## Bug Audit (2026-03-21)
124+
- Fixed: NetworkLog duration calculation used `_netLogEntry.timestamp` which was undefined; replaced with dedicated `_netLogStartTime` variable
125+
- Fixed: `state.folders`, `state._collapsedFolders`, `state._lastCheckedId`, `state._quotaWarned` not initialized in dashboard state object
126+
- Fixed: `switchTab('help')` in command palette failed because help tab is a header icon, not a `.tm-tab`; added special case handling
127+
- Verified: All version strings match (v1.6.0 across manifest, manifest-firefox, content.js, popup.js, dashboard.js)
128+
- Verified: All bg/ modules load before background.core.js in build output
129+
- Verified: `escapeHtml` available in popup.js (shared/utils.js loaded first)
130+
- Verified: Column index mapping still correct after pin button addition (pin is inside actions TD, not a new column)

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</p>
1010

1111
<p align="center">
12-
<img src="https://img.shields.io/badge/version-1.5.0-22c55e?style=flat-square" alt="Version">
12+
<img src="https://img.shields.io/badge/version-1.6.0-22c55e?style=flat-square" alt="Version">
1313
<img src="https://img.shields.io/badge/manifest-v3-60a5fa?style=flat-square" alt="Manifest V3">
1414
<img src="https://img.shields.io/badge/license-MIT-orange?style=flat-square" alt="License">
1515
<img src="https://img.shields.io/badge/chrome-120%2B-blue?style=flat-square" alt="Chrome 120+">
@@ -58,6 +58,24 @@ Plus `GM_getTab`, `GM_saveTab`, `GM_getTabs` for cross-tab state management.
5858
- **Find Scripts** &mdash; Search and install userscripts from Greasy Fork and other sources directly in the dashboard
5959
- **Bulk operations** &mdash; Select multiple scripts to enable, disable, update, reset, or delete with progress tracking
6060
- **Per-script export** &mdash; Export individual scripts as `.user.js` files
61+
- **Script templates** &mdash; 6 starter templates (blank, page modifier, CSS injector, API interceptor, SPA script, cross-site request)
62+
- **Version rollback** &mdash; Auto-saves last 3 versions on update; one-click rollback from info panel
63+
- **Storage quota monitor** &mdash; Visual quota bar with warning when approaching Chrome's 10MB limit
64+
- **Tag filtering** &mdash; Filter scripts by `@tag` metadata in the dashboard dropdown
65+
- **Drag-and-drop install** &mdash; Drop `.user.js` or `.zip` files onto the dashboard to install
66+
- **Shift+click multi-select** &mdash; Select ranges of scripts with Shift+click
67+
- **Library browser** &mdash; Search and add CDN libraries (`@require`) from cdnjs directly in the editor
68+
- **Advanced filters** &mdash; Filter scripts by grant type, error status, update URL, scope breadth, or tags
69+
- **Code snippets** &mdash; Insert GM API templates directly from the editor toolbar
70+
- **Keyboard shortcuts** &mdash; Ctrl+N new, Alt+1-5 switch tabs, Ctrl+W close tab, Ctrl+Tab cycle tabs
71+
- **Script pinning** &mdash; Pin favorite scripts to the top of the list
72+
- **Pattern tester** &mdash; Test any URL to see which scripts would run on it
73+
- **Activity log** &mdash; Timestamped log of all installs, updates, and errors
74+
- **Script health** &mdash; Visual indicators for scripts with errors or stale updates
75+
- **Tampermonkey import** &mdash; Import from Tampermonkey's `.txt` backup format
76+
- **Batch URL install** &mdash; Paste multiple `.user.js` URLs to install at once
77+
- **Script notes** &mdash; Personal notes per script, saved with settings
78+
- **Version diff view** &mdash; Compare any previous version against current code
6179

6280
### Advanced URL Matching
6381

@@ -103,7 +121,7 @@ Sync scripts across devices with 5 providers:
103121

104122
- **ZIP** &mdash; Full backup with scripts + settings
105123
- **JSON** &mdash; Text-based backup
106-
- **File import** &mdash; Drag and drop `.user.js` or `.zip` files directly into the dashboard
124+
- **File import** &mdash; Drag and drop `.user.js` or `.zip` files anywhere on the dashboard
107125
- **URL import** &mdash; Install directly from any URL
108126
- **Clipboard import** &mdash; Paste script code directly
109127

@@ -240,6 +258,18 @@ English &bull; German &bull; Spanish &bull; French &bull; Japanese &bull; Portug
240258
| Cloud Sync (5 providers) | Yes | Yes | Yes |
241259
| Tabbed Multi-Script Editor | Yes | No | No |
242260
| Built-in Script Search | Yes | No | No |
261+
| Script Templates | 6 | No | No |
262+
| Version Rollback | Yes (3) | No | No |
263+
| CDN Library Browser | Yes | No | No |
264+
| Drag-and-Drop Install | Yes | Yes | No |
265+
| Tag Filtering | Yes | No | No |
266+
| Script Pinning | Yes | No | No |
267+
| Pattern Tester | Yes | No | No |
268+
| Activity Log | Yes | No | No |
269+
| Script Health Indicators | Yes | No | No |
270+
| Tampermonkey Import | Yes | N/A | No |
271+
| Version Diff View | Yes | No | No |
272+
| Storage Quota Monitor | Yes | No | No |
243273
| Bulk Operations w/ Progress | Yes | Yes | No |
244274
| 4 UI Themes | Yes | No | Yes |
245275
| Open Source | MIT | No | Yes |
@@ -295,6 +325,6 @@ MIT License &mdash; see [LICENSE](LICENSE) for details.
295325
---
296326

297327
<p align="center">
298-
<strong>ScriptVault v1.5.0</strong><br>
328+
<strong>ScriptVault v1.6.0</strong><br>
299329
<em>Your scripts, your rules &mdash; locked down and loaded</em>
300330
</p>

0 commit comments

Comments
 (0)