diff options
author | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-11 19:26:49 +0000 |
---|---|---|
committer | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-11 19:26:49 +0000 |
commit | c4719b629a473d43e6508ef259ae8ff8fefe89d6 (patch) | |
tree | d906b85f9139504a61a5fd1999d13f9dbd8a2293 | |
parent | e3fc9fe67d0b27ff578260bf1257da0b84d29dd7 (diff) | |
download | chromium_src-c4719b629a473d43e6508ef259ae8ff8fefe89d6.zip chromium_src-c4719b629a473d43e6508ef259ae8ff8fefe89d6.tar.gz chromium_src-c4719b629a473d43e6508ef259ae8ff8fefe89d6.tar.bz2 |
Merge 287892 "Don't pushState when setting the search page to it..."
> Don't pushState when setting the search page to itself.
>
> Calling pushState when the search page is shown causes history entries after
> the current one to be lost.
>
> This mimics the pre-r271538 behavior where it set location.hash. Setting
> location.hash is a no-op (rather than pushing a duplicate history entry) if the
> hash has not changed.
>
> BUG=401004
>
> Review URL: https://codereview.chromium.org/446093002
TBR=davidben@chromium.org
Review URL: https://codereview.chromium.org/465633002
git-svn-id: svn://svn.chromium.org/chrome/branches/2062/src@288760 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/options/search_page.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/resources/options/search_page.js b/chrome/browser/resources/options/search_page.js index cd72ba5..5d65f7c 100644 --- a/chrome/browser/resources/options/search_page.js +++ b/chrome/browser/resources/options/search_page.js @@ -269,10 +269,12 @@ cr.define('options', function() { // Cleanup the search query string. text = SearchPage.canonicalizeQuery(text); - // Set the hash on the current page, and the enclosing uber page + // Set the hash on the current page, and the enclosing uber page. Only do + // this if the page is not current. See https://crbug.com/401004. var hash = text ? '#' + encodeURIComponent(text) : ''; var path = text ? this.name : ''; - uber.pushState({}, path + hash); + if (location.hash != hash || location.pathname != '/' + path) + uber.pushState({}, path + hash); // Toggle the search page if necessary. if (text) { |