golang/go

x/pkgsite: change browser URL to canonical path

开放

#40,936 创建于 2020年8月20日

 (0 条评论) (0 个反应) (0 位负责人)Go (19,008 个派生)batch import
NeedsInvestigationhelp wantedpkgsite

仓库指标

星标
 (133,883 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

If the URL passed to the frontend is path@version.

it resolves this internally to module@version/suffix.

and all the links it puts on the page have this form. However, the browser URL still says "path@version".

We could use window.history.replaceState to change the browser URL without a page reload. According to https://computerrock.com/blog/html5-changing-the-browser-url-without-refreshing-page, it is available in modern browsers.

/cc @jba @jamalc

贡献者指南