ng-dependency-graph
ng-dependency-graph copied to clipboard
Update Chrome extension manifest to v3
This PR migrates the Chrome extension from Manifest v2 to Manifest v3 to comply with Chrome's recommendations and ensure continued compatibility with modern Chrome versions.
Key Changes Made
Manifest Configuration
- Updated
manifest_versionfrom 2 to 3 - Converted background page to service worker (
app/background.js) - Updated Content Security Policy to v3 object format
- Split permissions into
permissionsandhost_permissionsfor better security - Raised minimum Chrome version to 88 (required for Manifest v3)
API Migration
The extension now uses Manifest v3 compatible APIs:
-
chrome.extension.onConnect→chrome.runtime.onConnect -
chrome.extension.connect→chrome.runtime.connect -
chrome.extension.sendRequest→chrome.runtime.sendMessage -
chrome.tabs.sendRequest→chrome.tabs.sendMessage
Service Worker Conversion
- Removed
app/background.html(not needed for service workers) - Updated background script to work as a service worker
- Added message listener for runtime messages
Files Modified
-
manifest.json- Core v3 configuration updates -
app/background.js- Service worker implementation with v3 APIs -
app/scripts/app/AppCtrl.js- Runtime detection update -
app/scripts/core/appContext.js- Connection API migration -
app/scripts/core/chromeExtension.js- Message API updates -
app/scripts/core/dev.js- Tab messaging API update
Backward Compatibility
The extension maintains all existing functionality while being compatible with current and future Chrome versions. The changes are minimal and surgical, preserving the AngularJS dependency graph features users rely on.
Fixes #25.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.