Repository navigation
Remove dead window load listener in a-scene - #5868
Open
vincentfretin wants to merge 1 commit into
Open
vincentfretin wants to merge 1 commit into
vincentfretin wants to merge 1 commit into
Conversation
attachedCallbackPostCamera registered window.addEventListener('load', resize)
with `resize` an undefined local variable, so it did nothing. Calling
self.resize there wouldn't help either: elements initialize after
aframeready, emitted once the document readyState is complete, and
attachedCallbackPostCamera runs when the camera is ready, so the window
load event has already fired. The scene is resized when the renderer is
set up, after the canvas is created, when rendering starts, on enter and
exit VR and on window resize.
This was referenced Nov 27, 2026
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.
attachedCallbackPostCameraregisteredwindow.addEventListener('load', resize)withresizean undefined local variable, so it never did anything (it has been like this since the WebVR 1.0 changes in 2016).Replacing it with
self.resizewouldn't help either: elements initialize afteraframeready, emitted once the documentreadyStateiscomplete, andattachedCallbackPostCameraruns when the camera is ready, so the windowloadevent has already fired when the listener would be added. The scene is already resized when the renderer is set up, after the canvas is created, when rendering starts, on enter/exit VR and on windowresize.Found while reviewing the patches of 8th Wall's 8-Frame fork, which had changed this line to
self.resize(https://github.com/orgs/8thwall/discussions/300).🤖 Generated with Claude Code