Skip to content

Commit c8fdec9

Browse files
Remove leftover debug console.log statements
Several debug `console.log` calls were left in and ship in 4.3.x, spamming the browser console on normal use: on every page load the model-viewer base logs `[onExtraModelChanged]`, `IntersectionObserver fired!`, `[$updateSource] called!` and `[$updateSource] BAILING OUT EARLY!`, the AR flow logs `Attempting to present in AR with ...`, and ARRenderer logs `[processInput] Setting goalPosition.y ...`. Remove these developer debug logs. The genuine error diagnostic in Renderer.ts ("could not acquire 2d context") is left untouched.
1 parent 111348d commit c8fdec9

3 files changed

Lines changed: 0 additions & 14 deletions

File tree

packages/model-viewer/src/features/ar.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,6 @@ configuration or device capabilities');
278278
}
279279

280280
protected async[$enterARWithWebXR]() {
281-
console.log('Attempting to present in AR with WebXR...');
282-
283281
await this[$triggerLoad]();
284282

285283
try {
@@ -395,7 +393,6 @@ configuration or device capabilities');
395393
self.addEventListener('hashchange', undoHashChange, {once: true});
396394

397395
this[$arAnchor].setAttribute('href', intent);
398-
console.log('Attempting to present in AR with Scene Viewer...');
399396
this[$arAnchor].click();
400397
}
401398

@@ -450,7 +447,6 @@ configuration or device capabilities');
450447
if (!anchor.isConnected)
451448
this.shadowRoot!.appendChild(anchor);
452449

453-
console.log('Attempting to present in AR with Quick Look...');
454450
anchor.click();
455451
anchor.removeChild(img);
456452
if (generateUsdz) {

packages/model-viewer/src/model-viewer-base.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,6 @@ export default class ModelViewerElementBase extends ReactiveElement {
223223
const extraModels = Array.from(this.querySelectorAll('extra-model'));
224224
const childIndex = (extraModels as HTMLElement[]).indexOf(targetNode);
225225

226-
console.log(`[onExtraModelChanged] childIndex: ${childIndex} srcChanged: ${
227-
customEv.detail.srcChanged} offset: ${customEv.detail.offset}`);
228-
229226
if (childIndex === -1)
230227
return;
231228

@@ -349,8 +346,6 @@ export default class ModelViewerElementBase extends ReactiveElement {
349346
const oldVisibility = this.modelIsVisible;
350347
this[$isElementInViewport] = entry.isIntersecting;
351348
this[$announceModelVisibility](oldVisibility);
352-
console.log(`IntersectionObserver fired! isIntersecting: ${
353-
entry.isIntersecting}`);
354349
if (this[$isElementInViewport] && !this.loaded) {
355350
this[$updateSource]();
356351
}
@@ -681,12 +676,8 @@ export default class ModelViewerElementBase extends ReactiveElement {
681676
const extraUrlsMatch =
682677
extraUrlsList.join(',') === (scene.extraUrls || []).join(',');
683678

684-
console.log(`[$updateSource] called! \nsrc: ${this.src}\nextraUrls: ${
685-
extraUrlsList.join(',')}\nloaded: ${this.loaded}`);
686-
687679
if (this.loaded || !this[$shouldAttemptPreload]() ||
688680
(this.src === scene.url && extraUrlsMatch)) {
689-
console.log('[$updateSource] BAILING OUT EARLY!');
690681
return;
691682
}
692683

packages/model-viewer/src/three-components/ARRenderer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,6 @@ export class ARRenderer extends EventDispatcher<
10681068
// control
10691069
if (this.isWorldSpaceReady()) {
10701070
// Use the hit point directly without floor constraints
1071-
console.log('[processInput] Setting goalPosition.y to hit.y:', hit.y);
10721071
this.goalPosition.add(hit);
10731072
} else if (this.placeOnWall === false) {
10741073
// Original logic for screen-space or initial world-space placement

0 commit comments

Comments
 (0)