-
Notifications
You must be signed in to change notification settings - Fork 262
Update Clarity DevTools to use Manifest V3 #1002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the Clarity DevTools Chrome extension from Manifest V2 to Manifest V3, implementing the required API changes and improving error handling and connection management throughout the codebase.
Key changes:
- Updated manifest.json to use Manifest V3 format with service worker background script, updated permissions model, and CSP policies
- Refactored background connection logic with retry mechanisms and improved error handling
- Migrated to async/await patterns for Chrome extension APIs (storage, messaging)
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/clarity-devtools/static/manifest.json | Updated to Manifest V3 format: changed manifest_version to 3, replaced browser_action with action, converted background scripts to service_worker, split permissions into permissions and host_permissions arrays, and added CSP policy |
| packages/clarity-devtools/tsconfig.json | Updated TypeScript target to ES2017 and simplified lib array to match the new target |
| packages/clarity-devtools/src/background.ts | Refactored to use Map for connections, converted to async/await for message handling, updated to use chrome.action API (Manifest V3), and improved error logging |
| packages/clarity-devtools/src/panel.ts | Implemented reconnection logic with retry mechanism, added error handling for message processing, and improved connection state management |
| packages/clarity-devtools/src/popup.ts | Converted to async/await for storage operations and added comprehensive error logging |
| packages/clarity-devtools/static/popup.html | Removed onload attribute to rely on script self-execution |
| packages/clarity-devtools/src/content.ts | Refactored activation logic to handle async initialization, replaced inline script injection with CustomEvent dispatch for CSP compliance, improved error handling for extension context invalidation |
| packages/clarity-devtools/src/clarity.ts | Added CustomEvent listener to receive settings (CSP-compliant replacement for inline script injection) |
| packages/clarity-devtools/package.json | Updated @types/chrome dependency from 0.0.212 to 0.0.280 |
| yarn.lock | Updated @types/chrome package to version 0.0.280 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b103dbd to
79195cc
Compare
…nection handling - Changed manifest_version from 2 to 3 and updated minimum_chrome_version to 88. - Refactored background connection logic in panel.ts to handle reconnections with retries. - Enhanced error handling for message processing in panel.ts. - Updated popup.ts to use async/await for storage operations and improved error logging. - Updated TypeScript configuration to target ES2017 and use the appropriate library.
… ensure DOM elements are present in popup
79195cc to
7a18221
Compare
Update Clarity DevTools to use Manifest V3 and improve backend connection handling