@@ -4814,58 +4814,6 @@ function registerSearchEvents() {
4814
4814
searchState . inputElement ( ) . addEventListener ( "blur" , ( ) => {
4815
4815
searchState . inputElement ( ) . placeholder = searchState . inputElement ( ) . origPlaceholder ;
4816
4816
} ) ;
4817
-
4818
- // Push and pop states are used to add search results to the browser
4819
- // history.
4820
- if ( browserSupportsHistoryApi ( ) ) {
4821
- // Store the previous <title> so we can revert back to it later.
4822
- const previousTitle = document . title ;
4823
-
4824
- window . addEventListener ( "popstate" , e => {
4825
- const params = searchState . getQueryStringParams ( ) ;
4826
- // Revert to the previous title manually since the History
4827
- // API ignores the title parameter.
4828
- document . title = previousTitle ;
4829
- // When browsing forward to search results the previous
4830
- // search will be repeated, so the currentResults are
4831
- // cleared to ensure the search is successful.
4832
- currentResults = null ;
4833
- // Synchronize search bar with query string state and
4834
- // perform the search. This will empty the bar if there's
4835
- // nothing there, which lets you really go back to a
4836
- // previous state with nothing in the bar.
4837
- if ( params . search !== undefined ) {
4838
- searchState . inputElement ( ) . value = params . search ;
4839
- // Some browsers fire "onpopstate" for every page load
4840
- // (Chrome), while others fire the event only when actually
4841
- // popping a state (Firefox), which is why search() is
4842
- // called both here and at the end of the startSearch()
4843
- // function.
4844
- e . preventDefault ( ) ;
4845
- search ( ) ;
4846
- } else {
4847
- // When browsing back from search results the main page
4848
- // visibility must be reset.
4849
- searchState . hideResults ( ) ;
4850
- }
4851
- } ) ;
4852
- }
4853
-
4854
- // This is required in firefox to avoid this problem: Navigating to a search result
4855
- // with the keyboard, hitting enter, and then hitting back would take you back to
4856
- // the doc page, rather than the search that should overlay it.
4857
- // This was an interaction between the back-forward cache and our handlers
4858
- // that try to sync state between the URL and the search input. To work around it,
4859
- // do a small amount of re-init on page show.
4860
- window . onpageshow = ( ) => {
4861
- const qSearch = searchState . getQueryStringParams ( ) . search ;
4862
- if ( qSearch !== undefined ) {
4863
- if ( searchState . inputElement ( ) . value === "" ) {
4864
- searchState . inputElement ( ) . value = qSearch ;
4865
- }
4866
- search ( ) ;
4867
- }
4868
- } ;
4869
4817
}
4870
4818
4871
4819
function updateCrate ( ev ) {
0 commit comments