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

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

Issue 3074007: Avoid js exception in history.pushState by not changing url per csilv (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 5 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/options_page.js
diff --git a/chrome/browser/resources/options/options_page.js b/chrome/browser/resources/options/options_page.js
index e497d9127ff92eb0908bb141a54eb8f995d4b30e..c1b25972b8c8647d757531cfab95ad770b75ce8e 100644
--- a/chrome/browser/resources/options/options_page.js
+++ b/chrome/browser/resources/options/options_page.js
@@ -114,6 +114,16 @@ OptionsPage.registerOverlay = function(page) {
};
/**
+ * Callback for window.onpopstate.
+ * @param {Object} data State data pushed into history.
+ */
+OptionsPage.setState = function(data) {
+ if (data && data.pageName) {
+ OptionsPage.showPageByName(data.pageName);
+ }
+};
+
+/**
* Initializes the complete options page. This will cause
* all C++ handlers to be invoked to do final setup.
*/
@@ -151,9 +161,9 @@ OptionsPage.prototype = {
var overlay = $('overlay');
overlay.classList.remove('hidden');
} else {
+ // Recent webkit change no longer allows url change from "chrome://".
window.history.pushState({pageName: this.name},
- this.title,
- '/' + this.name);
+ this.title);
}
if (this.tab) {
this.tab.classList.add('navbar-item-selected');
« 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