Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ee9b804

Browse files
authoredApr 17, 2023
Rollup merge of #110341 - notriddle:notriddle/main-js-replacestate, r=GuillaumeGomez
rustdoc: stop passing a title to `replaceState` second argument As described on [MDN's replaceState page], this parameter is not currently used, and the empty string is "safe against future changes to the method." [MDN's replaceState page]: https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
2 parents f5222cd + 0c61f58 commit ee9b804

File tree

1 file changed

+2
-4
lines changed
  • src/librustdoc/html/static/js

1 file changed

+2
-4
lines changed
 

‎src/librustdoc/html/static/js/main.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,7 @@ function preLoadCss(cssUrl) {
275275
document.title = searchState.titleBeforeSearch;
276276
// We also remove the query parameter from the URL.
277277
if (browserSupportsHistoryApi()) {
278-
history.replaceState(null, window.currentCrate + " - Rust",
279-
getNakedUrl() + window.location.hash);
278+
history.replaceState(null, "", getNakedUrl() + window.location.hash);
280279
}
281280
},
282281
getQueryStringParams: () => {
@@ -378,8 +377,7 @@ function preLoadCss(cssUrl) {
378377
searchState.clearInputTimeout();
379378
switchDisplayedElement(null);
380379
if (browserSupportsHistoryApi()) {
381-
history.replaceState(null, window.currentCrate + " - Rust",
382-
getNakedUrl() + window.location.hash);
380+
history.replaceState(null, "", getNakedUrl() + window.location.hash);
383381
}
384382
ev.preventDefault();
385383
searchState.defocus();

0 commit comments

Comments
 (0)
Please sign in to comment.