Skip to content

Instantly share code, notes, and snippets.

@martinschierle
Created August 5, 2020 13:03
Show Gist options
  • Save martinschierle/6ddb2751ece601023dd44eab0797a7ac to your computer and use it in GitHub Desktop.
Save martinschierle/6ddb2751ece601023dd44eab0797a7ac to your computer and use it in GitHub Desktop.
Use this snippet in "inject script" in advanced tab of webpagetest. When you do later customize waterfall and show custom marks, you will see layout jumps in wpt waterfall.
let po = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
//console.log(entry);
let val = entry.value;
window.performance.mark('layout_shift_'+val);
}
});
po.observe({type: 'layout-shift', buffered: true});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment