Issues

PageSpeed: Legacy JavaScript

back to issues overview

Legacy JavaScript

Pages with legacy JavaScript. Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren’t necessary for modern browsers.

How to Analyse in the SEO Spider

To populate this filter the PageSpeed Insights API must be connected via ‘Config > API Access > PSI’.

View URLs with this issue in the ‘PageSpeed’ tab and filter and use the lower ‘Lighthouse Details’ tab to click on the issue on the left-hand side, and see details of the JavaScript on the right-hand side.

Bulk export the pages and details of the legacy JS via ‘Reports > PageSpeed > Legacy JavaScript’.

What Triggers This Issue

This issue is triggered when pages include legacy JavaScript, such as polyfills and transforms, that are meant to enable legacy browsers to use new JavaScript features.

How To Fix

For your bundled JavaScript, adopt a modern script deployment strategy using module/nomodule feature detection to reduce the amount of code shipped to modern browsers, while retaining support for legacy browsers.

Further Reading

Back to top