File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,18 @@ export default defineComponent({
360360 setup () {
361361 const defaultDomain = ' en.wikipedia-on-ipfs.org'
362362 const running = ref (false )
363- const domain = ref (defaultDomain )
363+
364+ // Check for domain in URL fragment (e.g., #example.com)
365+ const fragmentDomain = typeof window !== ' undefined' && window .location .hash
366+ ? window .location .hash .slice (1 ).trim ()
367+ : ' '
368+
369+ // Only use fragment if it looks like a DNS name (contains at least one dot)
370+ const initialDomain = fragmentDomain && fragmentDomain .includes (' .' )
371+ ? fragmentDomain
372+ : defaultDomain
373+
374+ const domain = ref (initialDomain )
364375 const advanced = ref (false )
365376 const endpoints = ref <string []>([FALLBACK_ENDPOINT ])
366377 wellknown .data ().then (
You can’t perform that action at this time.
0 commit comments