Skip to content

Commit

Permalink
Merge pull request #62 from hotwired/disable-link-prefetching
Browse files Browse the repository at this point in the history
Disable link prefetching via the turbo js adapter to prevent double-visit requests
  • Loading branch information
jayohms authored Dec 18, 2024
2 parents ed93291 + 54187a3 commit 22dd671
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/Turbo/WebView/turbo.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@
this.postMessage("pageInvalidated")
}

linkPrefetchingIsEnabledForLocation(location) {
// Disable link prefetching since it can be activated by link taps and
// cause double-requests across the default/modal context boundaries. We
// also don't want to prefetch links that may correspond to native screens.
return false
}

log(message) {
this.postMessage("log", { message: message })
}
Expand Down

0 comments on commit 22dd671

Please sign in to comment.