Skip to content

Instantly share code, notes, and snippets.

@sunnyluthra
Created April 13, 2014 04:08
Show Gist options
  • Save sunnyluthra/10568795 to your computer and use it in GitHub Desktop.
Save sunnyluthra/10568795 to your computer and use it in GitHub Desktop.
//To support android stock browser
/**
@private
Pushes a new state
@method pushState
@param path {String}
*/
pushState: function(path) {
var state = { path: path };
get(this, 'history').pushState(state, null, path);
// store state if browser doesn't support `history.state`
if (!supportsHistoryState) {
this._historyState = state;
} else {
}
// used for webkit workaround
this._previousURL = this.getURL();
},
/**
@private
Replaces the current state
@method replaceState
@param path {String}
*/
replaceState: function(path) {
var state = { path: path };
get(this, 'history').replaceState(state, null, path);
// store state if browser doesn't support `history.state`
if (!supportsHistoryState) {
this._historyState = state;
} else {
}
// used for webkit workaround
this._previousURL = this.getURL();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment