This sample demonstrates using the chrome.debugger
API to capture network events on webpages.
The extension calls chrome.debugger.attach()
on a tab to capture network events when you click the extension's action button. The response data is logged in the developer console, to demonstrate extracting a network response's data such as the request headers and URL.
- Clone this repository.
- Load this directory in Chrome as an unpacked extension.
- Navigate to an HTTP/HTTPS webpage and open the devtools window.
- Pin the extension to the browser's taskbar and click on the action button to see the network event data logged to the console.