Skip to content

Commit

Permalink
chore: tweak a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Nov 19, 2023
1 parent d63cb86 commit 799659d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export function createRouter(
link.baseURI
)
const currentUrl = window.location
const mimeType = lookup(pathname)
// only intercept inbound links
if (
!e.ctrlKey &&
Expand All @@ -190,8 +191,8 @@ export function createRouter(
!e.metaKey &&
!target &&
origin === currentUrl.origin &&
// don't intercept if non-html extension is present
(lookup(pathname) == null || lookup(pathname) === 'text/html')
// intercept only html and unknown types (assume html)
(!mimeType || mimeType === 'text/html')
) {
e.preventDefault()
if (
Expand Down

0 comments on commit 799659d

Please sign in to comment.