How to replace deprecated browser APIs
Deprecated APIs still work today but will be removed. Chrome lists each one with its replacement.
Step by step, with screenshots: Console errors and deprecated APIs: what the report flags →
Check your own site
Runs this check and the other 192, free, in about 45 seconds.
What it is
Deprecated APIs are browser features that still work but are scheduled for removal, such as unload event handlers, synchronous XMLHttpRequest on the main thread or old mutation events. Chrome logs a warning for each one it sees, and Lighthouse reports them as "Uses deprecated APIs".
When the browser finally removes a feature, the code that relied on it stops working overnight, usually inside an old plugin, tracker or library you did not write. Mutation events, for example, were removed from Chrome in 2024 after years of warnings.
OK looks like this: no deprecation warnings when the page loads, or only ones from third parties you have already asked to update. getReport lists each deprecated feature Chrome reports, with the replacement it suggests.
What a passing site looks like
- No deprecated browser features in usewarning · −1 ptseffort M
Deprecated browser features
Why it matters. Chrome warns about features it plans to remove. When that happens the feature stops working overnight, usually inside an old plugin or tracker.
- Open the technical detail to see which feature triggered the warning, then update the plugin or library that uses it.
- If the code is your own, follow the replacement Chrome links to in the warning.
Questions people ask
What does uses deprecated APIs mean in Lighthouse?
It means Chrome saw the page use at least one browser feature marked for removal. The audit lists each feature and the script that used it. The page works today, but will break when Chrome removes the feature, so update the library or plugin named in the report.
Which browser APIs are deprecated?
Common ones on websites are unload event listeners, synchronous XMLHttpRequest on the main thread, document.domain changes, old mutation events such as DOMSubtreeModified, and some legacy CSS and plugin features. Chrome's deprecation messages name each one and link to its replacement.
How do you fix deprecated API warnings?
Find the script responsible in the warning, then update it: install the newest version of the plugin, library or tag, or ask the vendor for one. For your own code, follow the replacement Chrome suggests, such as pagehide or visibilitychange instead of unload.