Get URL's of files loaded by the browser


Use performance.getEntries() to get a list of resources loaded in the browser:

performance.getEntries();

Stylesheet

To get the stylesheet URL’s loaded in the browser:

performance
  .getEntries()
  .map(entry => entry.name)
  .filter(url => url.includes('.css'));

Scripts

To get the script URL’s loaded in the browser:

performance
  .getEntries()
  .map(entry => entry.name)
  .filter(url => /\.js$/.test(url));


Please support this site and join our Discord!