ng-dependency-graph icon indicating copy to clipboard operation
ng-dependency-graph copied to clipboard

Update Chrome extension manifest to v3

Open Copilot opened this issue 5 months ago • 0 comments

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_version from 2 to 3
  • Converted background page to service worker (app/background.js)
  • Updated Content Security Policy to v3 object format
  • Split permissions into permissions and host_permissions for better security
  • Raised minimum Chrome version to 88 (required for Manifest v3)

API Migration

The extension now uses Manifest v3 compatible APIs:

  • chrome.extension.onConnectchrome.runtime.onConnect
  • chrome.extension.connectchrome.runtime.connect
  • chrome.extension.sendRequestchrome.runtime.sendMessage
  • chrome.tabs.sendRequestchrome.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.

Copilot avatar Sep 08 '25 10:09 Copilot