Skip to content

Commit a2a9869

Browse files
committed
Let the browser do the reload on http-equiv refresh
1 parent b3a77d8 commit a2a9869

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

assets/js/swup.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ const emitExdocLoaded = () => {
1111
}
1212

1313
const maybeMetaRedirect = (visit, {page}) => {
14-
const match = page.html.match(/<meta\s+http-equiv\s*=\s*["']refresh["']\s+content\s*=\s*["']\d+\s*;\s*url\s*=\s*([^"']+)["']/i)
14+
const hasMetaRefresh = /<meta\s+http-equiv\s*=\s*["']refresh["']\s+content\s*=\s*["'][^"']*["']\s*\/?>/i.test(page.html)
1515

16-
if (match && match[1]) {
16+
if (hasMetaRefresh) {
1717
visit.abort()
18-
window.location.href = match[1]
18+
window.location.reload()
1919
}
2020
}
2121

formatters/html/dist/html-G6INCFPP.js renamed to formatters/html/dist/html-ALU6OERS.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)