Errors / Blocked by the browser
[Violation] Permissions policy violation: unload is not allowed in this document.
A script used an old way to run code when the visitor leaves, which Chrome is phasing out.
Code meant to run when the visitor leaves (saving a draft, sending a last analytics hit) does not run.
Why it happens
- Chrome is deprecating the
unloadevent and, on more and more sites, disables it through theunloadpermissions policy. - Old analytics, old jQuery plugins and some chat widgets still add
unloadlisteners.
How to fix it
- Replace
unloadwithpagehide(orvisibilitychangeto send analytics). - Update or replace the third-party script that adds it; its file is on the console line.
- An
unloadhandler that no longer runs means whatever it did no longer happens: an analytics beacon sent on leaving, a draft saved, a lock released. Check that each of those still reaches its server after the switch. Pages withoutunloadhandlers also keep Chrome's back/forward cache, so going back to them is instant.
Whose problem it is
Either the site's own code or a third party's, depending on where it comes from.
Does your site have it?
Free, no account. We open your page and four more in a clean Chrome and list every error like this one, with the page and the click that caused it. How the free page check works.
Often seen with
- DOMNodeInserted Mutation Event deprecatedA script watches the page with an old feature Chrome has removed.