From db49ef78f4757adf2de73f88206414f291608103 Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Wed, 2 Sep 2026 09:43:28 +0100 Subject: [PATCH] Version 2 improvements with UI and functionality --- CHANGELOG.md | 28 +++ CLAUDE.md | 106 +++++++++ README.md | 113 +++++++-- chrome/background.js | 39 ++- chrome/content.js | 395 ++++++++++++++++++++++++------ chrome/icon.svg | 15 ++ chrome/icon128.png | Bin 499 -> 4296 bytes chrome/icon16.png | Bin 115 -> 527 bytes chrome/icon48.png | Bin 202 -> 1450 bytes chrome/manifest.json | 16 +- chrome/popup.css | 280 +++++++++++++++++++++- chrome/popup.html | 134 ++++++++++- chrome/popup.js | 476 +++++++++++++++++++++++++++++++++---- firefox/background.js | 37 +++ firefox/content.js | 439 ++++++++++++++++++++++++++-------- firefox/icon.svg | 15 ++ firefox/icon128.png | Bin 499 -> 4296 bytes firefox/icon16.png | Bin 115 -> 527 bytes firefox/icon48.png | Bin 202 -> 1450 bytes firefox/manifest.json | 14 +- firefox/popup.css | 280 +++++++++++++++++++++- firefox/popup.html | 134 ++++++++++- firefox/popup.js | 466 +++++++++++++++++++++++++++++++++--- package-all.sh | 13 +- package-chrome-release.sh | 32 +++ package-firefox-release.sh | 32 +++ 26 files changed, 2750 insertions(+), 314 deletions(-) create mode 100644 CLAUDE.md create mode 100644 chrome/icon.svg create mode 100644 firefox/icon.svg create mode 100755 package-chrome-release.sh create mode 100755 package-firefox-release.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index caf3681..db7522d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,34 @@ All notable changes to GreasyBoii will be documented in this file. +## [2.0.0] - 2026-09-02 (Chrome and Firefox) + +### Added +- Visual element picker for the rule editor's Element Selector field +- Advanced rule actions: auto-click (once or repeating), find & replace text, + SPA re-apply (MutationObserver-based re-checking of a rule's match condition) +- Tools tab: bulk media downloader, link harvester (bulk-open/export), page data + scraper (CSV/JSON export) +- Rule import/export as JSON +- One-click "Dark Mode This Site" rule generator +- Master enable/disable kill-switch (`Ctrl+Shift+G`) with a toolbar badge +- New extension icon (shared design, rasterized separately per browser) + +### Changed +- Both `manifest.json` files now request the `downloads` permission (used only by the + bulk media downloader) and declare a `commands` shortcut for the kill-switch +- `package-all.sh` no longer hardcodes a version or zips inline; it now delegates to + `package-chrome-release.sh` and `package-firefox-release.sh`, which each read their + version from their own `manifest.json` + +### Notes +- Landed Firefox-first (element picker relayed through `storage.local`+`background.js` + since the popup closes before a page click, and JS rules injected via + `wrappedJSObject`/script-tag). Chrome reaches full feature parity in this same + release; its content script keeps routing JS injection through the background + service worker's `chrome.scripting.executeScript` (MAIN world) instead, since that + CSP-bypass mechanism was already Chrome's approach pre-2.0 — see CLAUDE.md. + ## [1.0.2] - 2024-10-16 ### Fixed diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..73076c4 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,106 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## What this is + +GreasyBoii is a browser extension (a lightweight Greasemonkey/Tampermonkey-style tool) that +injects custom JavaScript and CSS into pages based on URL-substring or CSS-selector match +rules, configured through a popup UI. There is no build system, package manager, or test +suite — it's plain HTML/CSS/JS shipped straight to the browser. + +## Repository layout + +The extension is maintained as two **parallel, independently-edited** implementations: + +- `chrome/` — Manifest V3 (service worker background script) +- `firefox/` — Manifest V2 (persistent background script, `browser.*` namespace) + +Each directory is a complete, self-contained extension (manifest, background script, content +script, popup HTML/CSS/JS, vendored Bootstrap, icons). **There is no shared source** — a +change to matching/rule logic in one directory must be manually ported to the other. When +editing behavior, always check whether the same fix is needed in both `chrome/*.js` and +`firefox/*.js`; diff the two files first (`diff chrome/foo.js firefox/foo.js`) to see how they +currently diverge before deciding how to apply a change to both. + +Key API differences between the two versions: +- Namespace: `chrome.*` vs. the promise-based `browser.*`. Style is otherwise mixed on the + Chrome side rather than uniform: `chrome/background.js` keeps the original + callback style throughout; `chrome/content.js` and `chrome/popup.js` were ported from + the Firefox files and use the promise form instead (valid since Chrome 88+ returns a + Promise from most `chrome.*` calls when the callback is omitted — the manifest already + requires Chrome 88+). Don't "fix" this into one style without checking both still work; + it's a leftover of how the port was done, not a bug. +- Chrome's `background.js` handles JS execution via `chrome.scripting.executeScript` (world: + `MAIN`) to bypass page CSP, relayed there from `chrome/content.js`'s `injectJavaScript`; + Firefox's `content.js` instead injects a `