From 86b5cfcb83d99be0019a24373f42228106c31f84 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Tue, 26 Jul 2016 20:00:29 +0000 Subject: [PATCH] Plugins: Use `history.pushState()` to customize the URL during searches. `history.pushState()` requires an event handler for `popstate` which doesn't exist (yet). Props rahulsprajapati for initial patch. Fixes #37233. git-svn-id: https://develop.svn.wordpress.org/trunk@38154 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/updates.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/js/updates.js b/src/wp-admin/js/updates.js index e1d963a1f2..accf0382f7 100644 --- a/src/wp-admin/js/updates.js +++ b/src/wp-admin/js/updates.js @@ -2056,8 +2056,8 @@ wp.updates.searchTerm = data.s; } - if ( window.history && window.history.pushState ) { - window.history.pushState( null, '', searchLocation ); + if ( window.history && window.history.replaceState ) { + window.history.replaceState( null, '', searchLocation ); } if ( ! $searchTab.length ) { @@ -2123,8 +2123,8 @@ wp.updates.searchTerm = data.s; } - if ( window.history && window.history.pushState ) { - window.history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s ); + if ( window.history && window.history.replaceState ) { + window.history.replaceState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s ); } if ( 'undefined' !== typeof wp.updates.searchRequest ) {