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

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: typo 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..0152017b9fae2c119308020c7dd6905107ba86ef 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 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) {
« 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