# browserstate/history.js

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/browserstate-history-js).**

10,659 stars · 1,307 forks · JavaScript · NOASSERTION

## Links

- GitHub: https://github.com/browserstate/history.js
- Homepage: http://browserstate.github.com/history.js/demo/
- awesome-repositories: https://awesome-repositories.com/repository/browserstate-history-js.md

## Topics

`hashchange` `html5-history` `html5-history-api` `javascript` `polyfill`

## Description

history.js is a cross-browser URL state manager and HTML5 History API polyfill. It functions as a single page application router that manages browser URL and history state consistently across HTML5 and HTML4 browsers, enabling navigation without triggering full page reloads.

The project provides a JavaScript framework adapter that integrates history management with the event systems of jQuery, MooTools, and Prototype. It ensures compatibility through a fallback mechanism that switches to hash-based navigation and hashbang URLs when the native HTML5 History API is unavailable.

The system covers broad capabilities including state management for associating and serializing data objects to history entries, asynchronous URL updates for AJAX state bookmarking, and session history navigation. It also includes support for crawler indexability, search history integration, and the ability to maintain continuous media playback during state changes.

## Tags

### Web Development

- [Single-Page Applications](https://awesome-repositories.com/f/web-development/single-page-applications.md) — Manages browser URL and history state to enable seamless navigation and bookmarkable states in single-page applications without full page reloads.
- [AJAX Page Loaders](https://awesome-repositories.com/f/web-development/ajax-page-loaders.md) — Fetches HTML fragments or JSON responses asynchronously to update page content without full reloads.
- [Stateful Bookmarking](https://awesome-repositories.com/f/web-development/ajax-page-loaders/stateful-bookmarking.md) — Creates unique, shareable URLs for asynchronous content loads by synchronizing the address bar with AJAX updates.
- [Browser API Normalizers](https://awesome-repositories.com/f/web-development/browser-api-normalizers.md) — Abstracts inconsistent browser history implementations into a single, unified API for pushState, replaceState, and popState.
- [Browser History Management](https://awesome-repositories.com/f/web-development/browser-history-management.md) — Synchronizes application state with browser history by standardizing the history interface across different browsers. ([source](https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling))
- [Hash-Based Fallbacks](https://awesome-repositories.com/f/web-development/browser-history-management/hash-based-fallbacks.md) — Automatically switches to hashchange events and hashbang URLs when the HTML5 History API is unavailable.
- [State Data Association](https://awesome-repositories.com/f/web-development/browser-history-management/history-state-encryption/state-data-association.md) — Attaches arbitrary data objects to each history entry and retrieves them when the entry becomes active. ([source](https://cdn.jsdelivr.net/gh/browserstate/history.js@master/README.md))
- [Legacy Browser Support](https://awesome-repositories.com/f/web-development/browser-integration-utilities/browser-compatibility-utilities/legacy-browser-support.md) — Provides fallback mechanisms using hashbang URLs to ensure navigation functionality in legacy browsers lacking native HTML5 History API support.
- [Feature Detection Polyfills](https://awesome-repositories.com/f/web-development/feature-detection-polyfills.md) — Implements runtime utilities to detect browser history capabilities and apply hash-based fallbacks for consistent behavior.
- [History API Polyfills](https://awesome-repositories.com/f/web-development/html5-compatibility-polyfills/history-api-polyfills.md) — Normalizes the HTML5 History API across browsers, providing pushState, replaceState, and popState support with automatic hash-based fallbacks.
- [History Stack Controllers](https://awesome-repositories.com/f/web-development/navigation-history-providers/history-stack-controllers.md) — Programmatically manipulates the URL and session state to enable SPA navigation without page reloads. ([source](https://github.com/browserstate/history.js/blob/master/History.md))
- [State Serializers](https://awesome-repositories.com/f/web-development/url-hash-tracking/state-serializers.md) — Encodes arbitrary JavaScript objects and titles into the URL hash for state persistence in legacy browsers.
- [URL Normalization Utilities](https://awesome-repositories.com/f/web-development/url-normalization-utilities.md) — Standardizes request paths by transparently converting between hash, hashbang, and clean URL formats.
- [URL State Management](https://awesome-repositories.com/f/web-development/url-state-management.md) — Synchronizes application state with the browser URL consistently across different browser versions to manage single-page application state.
- [Browser Session Management](https://awesome-repositories.com/f/web-development/browser-integration-utilities/browser-session-management.md) — Synchronizes URL changes and session state across browser implementations to ensure consistent navigation. ([source](https://github.com/browserstate/history.js/wiki/Articles))
- [Crawler-Friendly Rendering](https://awesome-repositories.com/f/web-development/crawler-friendly-rendering.md) — Delivers full HTML for direct URLs and partial content for AJAX requests to ensure dynamic content is indexable by search engines. ([source](https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling))
- [Cross-Framework Adapters](https://awesome-repositories.com/f/web-development/cross-framework-adapters.md) — Provides connectors that enable history management functionality across jQuery, MooTools, and Prototype frontend stacks.
- [Cross-Framework Integration Utilities](https://awesome-repositories.com/f/web-development/cross-framework-integration-utilities.md) — Provides a unified history management API that operates consistently across jQuery, MooTools, and Prototype environments.
- [Browser History API Updates](https://awesome-repositories.com/f/web-development/event-interception-frameworks/url-change-interceptors/browser-history-api-updates.md) — Handles hashbangs and history API updates uniformly to ensure consistent URL state across all browsers. ([source](https://github.com/browserstate/history.js/wiki/Articles))
- [Event System Adapters](https://awesome-repositories.com/f/web-development/framework-integrations/framework-component-adapters/event-system-adapters.md) — Integrates history management with the specific event systems of jQuery, MooTools, and Prototype.

### Data & Databases

- [Browser History Persistence](https://awesome-repositories.com/f/data-databases/state-persistence/browser-history-persistence.md) — Associates and serializes arbitrary JavaScript objects and titles to browser history entries for retrieval during session navigation.

### Software Engineering & Architecture

- [URL State Serialization](https://awesome-repositories.com/f/software-engineering-architecture/shared-state-management/url-state-serialization.md) — Encodes application state and titles into the URL hash or state object for shareable and persistent views.
- [Client-Side Routers](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/application-layer-architectures/application-architecture-patterns/client-side-routers.md) — Functions as a navigation manager that updates the browser URL and session state without triggering full page reloads.
- [Event Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/event-dispatchers.md) — Uses an event-driven architecture to decouple application state transitions from native browser navigation events.

### Testing & Quality Assurance

- [Browser History Navigations](https://awesome-repositories.com/f/testing-quality-assurance/browser-history-navigations.md) — Provides programmatic control to move the user forward or backward through the browser's session history. ([source](https://cdn.jsdelivr.net/gh/browserstate/history.js@master/README.md))

### User Interface & Experience

- [Browser Event Listeners](https://awesome-repositories.com/f/user-interface-experience/browser-event-listeners.md) — Provides mechanisms for capturing and responding to browser-level navigation and anchor change events. ([source](https://cdn.jsdelivr.net/gh/browserstate/history.js@master/README.md))
- [Application Event Dispatching](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/event-handling-architectures/input-event-dispatchers/application-event-dispatching.md) — Routes high-level statechange events to distinguish application transitions from ordinary anchor navigation.
