Skip to content

feat: Chrome Extension Enhancements & Documentation#29

Open
creativerezz wants to merge 6 commits intoaidenybai:mainfrom
creativerezz:feat/chrome-extension-v2
Open

feat: Chrome Extension Enhancements & Documentation#29
creativerezz wants to merge 6 commits intoaidenybai:mainfrom
creativerezz:feat/chrome-extension-v2

Conversation

@creativerezz
Copy link

Changes

  • Enhanced Chrome extension popup with error handling, loading states, and toast notifications
  • Added visual previews (screenshots, thumbnails & fullscreen mode)
  • Improved UX with validation and better user feedback
  • Added comprehensive documentation for LLM-specific project overview and architecture
  • Updated Chrome extension manifest
  • Added Chrome extension demo GIF to README

Testing

  • Tested Chrome extension functionality
  • All features working as expected

Introduce a new @react-grab/chrome-extension package that implements a Chrome
extension to capture DOM elements and send them to the React Grab adapter.

Highlights:
- Add manifest.json (MV3) with content script, service worker, permissions,
  action popup and web_accessible_resources.
- Add package.json with build/dev scripts and dependencies.
- Add scripts/generate-icons.sh to generate extension icons from favicon.ico
  (requires ImageMagick).
- Implement chrome adapter (src/adapters/chrome.ts) to send captured elements
  to the extension background.
- Implement background service worker (src/background.ts) to persist captured
  elements, show notifications and update action badge; handle runtime messages
  (capture, list, clear, delete).
- Add content script (src/content.ts) that initializes react-grab using stored
  settings, listens for storage changes and registers the chrome adapter.
- Add popup UI: popup.html and popup.ts to view/copy/delete captured elements
  and manage extension settings (enabled, hotkey, hold duration); live updates
  via chrome.storage changes.
- Add TypeScript tooling: tsconfig.json and tsup.config.ts to bundle content,
  background and popup into dist; copy manifest/popup on build.
- Bundle output targets and build helpers configured; icons directory created in
  dist but icon files are expected to be generated/copied during build.

This commit scaffolds the full Chrome extension integration for React Grab,
including message flows, storage, UI and build pipeline.
…& fullscreen)

- add html2canvas dependency and update pnpm-lock
- implement captureElementScreenshot & generateElementSelector utils
- add chrome-enhanced adapter with trackHoveredElement to capture screenshots & selectors
- update content/background to use enhanced adapter and clean up tracker
- add thumbnails, placeholder, and fullscreen modal to popup (UI + handlers)
- persist screenshot and elementSelector in captured elements
- add VISUAL_PREVIEWS.md documenting feature and implementation
…ates, toasts, validation & UX improvements; add docs

- Add robust try/catch handling for settings/elements loading and init recovery
- Return result types for loadSettings/loadCapturedElements and add DEFAULT_SETTINGS
- Implement loading state, inline error UI with retry, and fatal init recovery (reload)
- Add toast notifications (success/error/info) and button state feedback (disabled text)
- Add input validation for hotkey and duration, with user feedback and persistence
- Escape HTML content and lazy-load thumbnails to mitigate XSS and improve perf
- Improve element actions: copy feedback, delete confirmation/feedback, "Clear All" confirmation
- Minor DOM/query null-safety and UX tweaks (titles, placeholders, timestamps)
- Add POPUP_IMPROVEMENTS.md documenting changes and testing notes
@vercel
Copy link

vercel bot commented Nov 28, 2025

@creativerezz is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

@creativerezz
Copy link
Author

Hey @aidenybai! 👋

I've added a complete Chrome extension implementation for React Grab with some exciting features:

Key Features

  • 🎨 Visual Previews: Screenshots, thumbnails, and fullscreen mode for grabbed elements
  • 🔔 Enhanced UX: Error handling, loading states, and toast notifications
  • Validation: Better user feedback and input validation
  • 📚 Documentation: Comprehensive docs for LLM integration and architecture

Check out the demo GIF in the README to see it in action! Would love to hear your thoughts on this contribution. 🚀

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! You shouldn't commit your settings.local.json file.

I recommend creating a global ~/.gitignore file to catch the CLAUDE.local.md and settings.local.json files.

Typically the versions without *.local* are the ones committed in a repository if that is the standard for that particular repo.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same in relation to my comment above. I would remove this too if you're hoping for anything to get merged. I'm not a maintainer. Just a passerby.

@benjaminmodayil
Copy link

I am curious if there is a reason for an extension. In some instances I assume it could be hard to install a tool like react-grab in a project depending on seniority/approval from others. But it might be good to also create a "Why a Chrome Extension" and list of pros/cons versus the npm package approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments