chore: tweak a bit

pull/3233/head
Divyansh Singh 2 years ago
parent d63cb867b1
commit 799659dff9

@ -182,6 +182,7 @@ export function createRouter(
link.baseURI link.baseURI
) )
const currentUrl = window.location const currentUrl = window.location
const mimeType = lookup(pathname)
// only intercept inbound links // only intercept inbound links
if ( if (
!e.ctrlKey && !e.ctrlKey &&
@ -190,8 +191,8 @@ export function createRouter(
!e.metaKey && !e.metaKey &&
!target && !target &&
origin === currentUrl.origin && origin === currentUrl.origin &&
// don't intercept if non-html extension is present // intercept only html and unknown types (assume html)
(lookup(pathname) == null || lookup(pathname) === 'text/html') (!mimeType || mimeType === 'text/html')
) { ) {
e.preventDefault() e.preventDefault()
if ( if (

Loading…
Cancel
Save