devtools.network.getHAR()
Holen Sie sich ein HAR-Protokoll für die Seite, die im aktuellen Tab geladen ist.
Dies ist eine asynchrone Funktion, die ein Promise
zurückgibt.
Syntax
js
let getting = browser.devtools.network.getHAR()
Parameter
Keine.
Rückgabewert
Ein Promise
, das mit einem Objekt erfüllt wird, welches das HAR-Protokoll für den aktuellen Tab enthält. Für Details, was das Protokoll-Objekt enthält, lesen Sie die HAR-Spezifikation.
Browser-Kompatibilität
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.
Beispiele
Protokollieren Sie die URLs von Anfragen, die im HAR-Protokoll enthalten sind:
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);
Hinweis:
Diese API basiert auf Chromium's chrome.devtools.network
API.