获取 HAR log for the page loaded in the current tab.
This is an asynchronous function that returns a
Promise
.
var getting = browser.devtools.network.getHAR()
None.
A
Promise
that will be fulfilled with a object containing the HAR log for the current tab. For details of what the log object contains, refer to the
HAR specification
.
BCD tables only load in the browser
Log the URLs of requests contained in the HAR log:
async function logRequests() {
let harLog = await browser.devtools.network.getHAR();
console.log(`HAR version: ${harLog.version}`);
for (let entry of harLog.entries) {
console.log(entry.request.url);
}
}
logRequestsButton.addEventListener("click", logRequests);
注意:
This API is based on Chromium's
chrome.devtools.network
API。
最后修改: , 由 MDN 贡献者