基本信息
(function () {
if (!window.performance && !window.performance.getEntries) {
return false;
}
var result = [];
window.performance.getEntries().forEach((item) => {
result.push(
{
'url': item.name,
'entryType': item.entryType,
'type': item.initiatorType,
'duration(ms)': item.duration
});
});
console.table(result); })();
所有信息,直接把每个对象转为json可方便查看
(function () {
if (!window.performance && !window.performance.getEntries) {
return false;
}
var result = [];
window.performance.getEntries().forEach((item) => {
result.push(
{
'item': item.toJson()
});
});
console.table(result); })();