From c065505e1b82e6085ae142b6a8e2aacef11b403b Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 7 May 2024 15:20:24 +0100 Subject: [PATCH] fix(nuxt): preload links with same hostname --- packages/nuxt/src/app/plugins/payload.client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/plugins/payload.client.ts b/packages/nuxt/src/app/plugins/payload.client.ts index 3dc431e63d..48486c1a3e 100644 --- a/packages/nuxt/src/app/plugins/payload.client.ts +++ b/packages/nuxt/src/app/plugins/payload.client.ts @@ -23,8 +23,8 @@ export default defineNuxtPlugin({ onNuxtReady(() => { // Load payload into cache nuxtApp.hooks.hook('link:prefetch', async (url) => { - const { protocol } = new URL(url, window.location.href) - if (!protocol) { + const { hostname } = new URL(url, window.location.href) + if (hostname === window.location.hostname) { await loadPayload(url) } })