Skip to content

Conversation

@nairmanu
Copy link
Collaborator

Update Clarity DevTools to use Manifest V3 and improve backend connection 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.

Copy link

Copilot AI left a 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.

@nairmanu nairmanu requested a review from Copilot December 16, 2025 17:35
Copy link

Copilot AI left a 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.

Manu Nair added 2 commits December 19, 2025 13:23
…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.
@nairmanu nairmanu merged commit e329f04 into master Dec 19, 2025
5 checks passed
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.

4 participants