Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3311)

Unified Diff: chrome/browser/resources/options/search_page.js

Issue 446093002: Don't pushState when setting the search page to itself. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/search_page.js
diff --git a/chrome/browser/resources/options/search_page.js b/chrome/browser/resources/options/search_page.js
index 5706863c6818fad27a63095438ccad9d70ef4375..523802033f5fc54d5d4b12ecc9fc94d82e5cdbcd 100644
--- a/chrome/browser/resources/options/search_page.js
+++ b/chrome/browser/resources/options/search_page.js
@@ -267,10 +267,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 to
Dan Beam 2014/08/06 18:34:03 s/to/do/
davidben 2014/08/06 18:38:13 Done.
+ // 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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698