Skip to content

Commit

Permalink
Fix going back in history to a search result page on firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 19, 2020
1 parent 97f3eee commit ed84780
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustdoc/html/static/main.js
Expand Up @@ -2703,3 +2703,9 @@ function focusSearchBar() {
function defocusSearchBar() {
getSearchInput().blur();
}

// This is required in firefox. Explanations: when going back in the history, firefox doesn't re-run
// the JS, therefore preventing rustdoc from setting a few things required to be able to reload the
// previous search results (if you navigated to a search result with the keyboard, pressed enter on
// it to navigate to that result, and then came back to this page).
window.onunload = function(){};

0 comments on commit ed84780

Please sign in to comment.