mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(nuxt): preload links with same hostname
This commit is contained in:
parent
8bdd620ba1
commit
c065505e1b
@ -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)
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user