Repository navigation
Conversation
Chrome blocks the unload event when the DeprecateUnload feature is on (Permissions policy violation: unload is not allowed in this document). Switch the body handler of all commander*.htm pages to onpagehide. Fixes Ylianst#8335 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Collaborator
|
this should be fixed upstream also - https://github.com/Ylianst/MeshCommander |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8335
What
Replace
onunload="cleanup()"withonpagehide="cleanup()"on the<body>tag of all elevenpublic/commander*.htmpages.Why
Chrome is deprecating the
unloadevent and, with--enable-features=DeprecateUnload, blocks it withPermissions policy violation: unload is not allowed in this document.commander.ashxis loaded in a hidden iframe on every signed-in page, so the error shows up in the console of every session. When MeshCentral is embedded throughallowedFramingOrigins, the embedding site also has to allowunloadfor it to work.pagehideis the recommended replacement: it fires on navigation and on tab or iframe close, and it is not covered by the deprecation.Scope
HEAD; all 11 matched, so nothing else (BOM, line endings, the minified body) was touched.cleanup()itself, so the handler resolves in every locale.Not covered
pagehidebehaviour. A quick check from someone with the flag set up would be welcome.meshcentral-web/public. This PR does not touchhandleMeshCommander; I left that as a separate design decision.🤖 Generated with Claude Code