golang/go

x/pkgsite: change browser URL to canonical path

Aberta

#40.936 aberto em 20 de ago. de 2020

 (0 comentário) (0 reação) (0 responsável)Go (19.008 forks)batch import
NeedsInvestigationhelp wantedpkgsite

Métricas do repositório

Stars
 (133.883 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Guia do colaborador