# How Angular DevTools connects to a tab This describes how the extension wires the **Angular** panel in Chrome DevTools to the inspected page, per browser tab, and how it routes messages between them. It covers the real browser extension ("chrome shell"). The dev shell is noted at the end. ## The pieces | Script | Bundle | Where it runs | Job | | ---------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | ---------------------------------------------------------------------- | | Panel UI | [`index.html`](../projects/shell-browser/src/index.html) + [`main.ts`](../projects/shell-browser/src/main.ts) | The "Angular" DevTools panel frame | The `ng-devtools` Angular app the user sees | | Background | `background_bundle.js` ([`background.ts`](../projects/shell-browser/src/app/background.ts)) | Extension service worker | Hosts the `TabManager` that routes per tab; toggles toolbar icon/popup | | `ng-validate` content script | `ng_validate_bundle.js` ([`ng-validate.ts`](../projects/shell-browser/src/app/ng-validate.ts)) | Inspected page, isolated world, all frames | Injects `detect_angular_bundle.js` into the page's main world | | `detect-angular` | `detect_angular_bundle.js` ([`detect-angular.ts`](../projects/shell-browser/src/app/detect-angular.ts)) | Inspected page, main world | Reports whether the page is a supported Angular app | | Content script | `content_script_bundle.js` ([`content-script.ts`](../projects/shell-browser/src/app/content-script.ts)) | Inspected page, isolated world, all frames | Opens the port to the background, injects the backend, relays messages | | Backend | `backend_bundle.js` ([`backend.ts`](../projects/shell-browser/src/app/backend.ts)) | Inspected page, main world | Talks to Angular's debug APIs (`ng-devtools-backend`) | Two manifest-registered content scripts run in every frame (`all_frames: true`): `ng_validate_bundle.js` and `content_script_bundle.js`. The detect and backend bundles are `web_accessible_resources`, injected into the page's main world by a `