Home

# Class goog.history.Html5History

An implementation compatible with goog.History that uses the HTML5 history APIs.

extends goog.events.EventTarget

Instance Method Summary

`disposeInternal()`

Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:

    MyClass.prototype.disposeInternal = function() {
    MyClass.superClass_.disposeInternal.call(this);
    // Dispose logic for MyClass
    };

| `getPathPrefix() ⇒ string` Gets the path prefix.
| `getToken() ⇒ string` Returns the current token.
| `getUrl_(string token) ⇒ string` Gets the URL to set when calling history.pushState
| `onHistoryEvent_(?goog.events.BrowserEvent e)` Handles history events dispatched by the browser.
| `replaceToken(string token, string= opt_title)` Replaces the current history state without affecting the rest of the history stack.
| `setEnabled(boolean enable)` Starts or stops the History. When enabled, the History object will immediately fire an event for the current location. The caller can set up event listeners between the call to the constructor and the call to setEnabled.
| `setPathPrefix(string pathPrefix)` Sets the path prefix to use if storing tokens in the path. The path prefix should start and end with slash.
| `setToken(string token, string= opt_title)` Sets the history state.
| `setUseFragment(boolean useFragment)` Sets whether to use the fragment to store tokens.

Static Method Summary
| `isSupported(?Window= opt_win) ⇒ boolean` Returns whether Html5History is supported.