devtools.network.getHAR()
Get a HAR log for the page loaded in the current tab.
This is an asynchronous function that returns a Promise
.
Syntax
js
let getting = browser.devtools.network.getHAR()
Parameters
None.
Return value
A Promise
that will be fulfilled with an object containing the HAR log for the current tab. For details of what the log object contains, refer to the HAR specification.
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
getHAR |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Examples
Log the URLs of requests contained in the HAR log:
js
async function logRequests() {
let harLog = await browser.devtools.network.getHAR();
console.log(`HAR version: ${harLog.version}`);
for (const entry of harLog.entries) {
console.log(entry.request.url);
}
}
logRequestsButton.addEventListener("click", logRequests);
Note:
This API is based on Chromium's chrome.devtools.network
API.