golang/go

x/pkgsite: change browser URL to canonical path

Aperta

#40.936 aperta il 20 ago 2020

 (0 commenti) (0 reazioni) (0 assegnatari)Go (19.008 fork)batch import
NeedsInvestigationhelp wantedpkgsite

Metriche repository

Star
 (133.883 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor