Skip to content

网站启动sw.js后评论无法正常加载 #351

Answered by Mister-Hope
imjason asked this question in Q&A
Discussion options

You must be logged in to vote

如果你的网站没有把 /xxx/index.html 重定向到 /xxx/ 的行为,你可以传入以下的 path:

window.location.pathname.replace(/\/index\.html$/, '/').replace(/\.html$/, '')

总之,你可以自行确保显示为同一页面的不同路径最终被转换到相同的path。

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lizheming
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by imjason
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants