We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
yyx990803
kiaking
brc-dd
posva
Learn more about funding links in repositories.
Report abuse
1 parent 010b3e5 commit 1f77577Copy full SHA for 1f77577
src/client/theme-default/components/VPNavBarSearch.vue
@@ -78,6 +78,22 @@ function poll() {
78
}
79
}, 16)
80
81
+
82
+onMounted(() => {
83
+ const id = 'VPAlgoliaPreconnect'
84
85
+ const rIC = requestIdleCallback || setTimeout
86
+ rIC(() => {
87
+ if (!theme.value.algolia || document.head.querySelector(`#${id}`)) return
88
89
+ const preconnect = document.createElement('link')
90
+ preconnect.id = id
91
+ preconnect.rel = 'preconnect'
92
+ preconnect.href = `https://${theme.value.algolia.appId}-dsn.algolia.net`
93
+ preconnect.crossOrigin = ''
94
+ document.head.appendChild(preconnect)
95
+ })
96
+})
97
</script>
98
99
<template>
0 commit comments