Skip to content

Commit ed84780

Browse files
Fix going back in history to a search result page on firefox
1 parent 97f3eee commit ed84780

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustdoc/html/static/main.js

+6
Original file line numberDiff line numberDiff line change
@@ -2703,3 +2703,9 @@ function focusSearchBar() {
27032703
function defocusSearchBar() {
27042704
getSearchInput().blur();
27052705
}
2706+
2707+
// This is required in firefox. Explanations: when going back in the history, firefox doesn't re-run
2708+
// the JS, therefore preventing rustdoc from setting a few things required to be able to reload the
2709+
// previous search results (if you navigated to a search result with the keyboard, pressed enter on
2710+
// it to navigate to that result, and then came back to this page).
2711+
window.onunload = function(){};

0 commit comments

Comments
 (0)