我们知道我们可以使用PerformanceObserver Apis捕获FCP,如下所示:-
const observer = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
if (entry && entry.entryType === "paint" && entry.name === "first-contentful-paint") {
//Send events to server apis here.
}
}
});
开始观察您关心的条目类型。下方:-
observer.observe({ entryTypes: ['paint'] });
但是我找不到如何在AMP页面中捕获它。你能帮我吗?
谢谢!