diff --git a/src/core/drive/visit.js b/src/core/drive/visit.js index d1929b03e..9efafd512 100644 --- a/src/core/drive/visit.js +++ b/src/core/drive/visit.js @@ -102,7 +102,7 @@ export class Visit { } get silent() { - return this.isSamePage + return this.isSamePage || !this.willRender } start() { @@ -130,10 +130,8 @@ export class Visit { this.state = VisitState.completed this.followRedirect() - if (!this.followedRedirect) { - this.adapter.visitCompleted(this) - this.delegate.visitCompleted(this) - } + this.adapter.visitCompleted(this) + this.delegate.visitCompleted(this) } } diff --git a/src/core/session.js b/src/core/session.js index 44edc7856..b0db9658b 100644 --- a/src/core/session.js +++ b/src/core/session.js @@ -194,7 +194,9 @@ export class Session { visitCompleted(visit) { clearBusyState(document.documentElement) - this.notifyApplicationAfterPageLoad(visit.getTimingMetrics()) + if (!visit.silent) { + this.notifyApplicationAfterPageLoad(visit.getTimingMetrics()) + } } locationWithActionIsSamePage(location, action) { @@ -250,6 +252,8 @@ export class Session { } allowsImmediateRender({ element }, isPreview, options) { + if (this.navigator.currentVisit?.silent) return true + const event = this.notifyApplicationBeforeRender(element, isPreview, options) const { defaultPrevented, @@ -265,7 +269,9 @@ export class Session { viewRenderedSnapshot(_snapshot, isPreview) { this.view.lastRenderedLocation = this.history.location - this.notifyApplicationAfterRender(isPreview) + if (!this.navigator.currentVisit?.silent) { + this.notifyApplicationAfterRender(isPreview) + } } preloadOnLoadLinksForView(element) {