From f992dd9349f3223aa21dfcd14c0cc46823e70981 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Fri, 27 Nov 2026 20:42:56 +0100 Subject: [PATCH] Remove dead window load listener in a-scene 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. --- src/core/scene/a-scene.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/scene/a-scene.js b/src/core/scene/a-scene.js index 5eb16658301..3cf11990f11 100644 --- a/src/core/scene/a-scene.js +++ b/src/core/scene/a-scene.js @@ -159,10 +159,8 @@ export class AScene extends AEntity { } attachedCallbackPostCamera () { - var resize; var self = this; - window.addEventListener('load', resize); window.addEventListener('resize', function () { // Workaround for a Webkit bug (https://bugs.webkit.org/show_bug.cgi?id=170595) // where the window does not contain the correct viewport size