← All projects
Project record1 mention
Originally shared on Hacker News

navigation-ponyfill

A JavaScript ponyfill for the browser's new Navigation API. It implements navigation.canGoBack and the currententrychange event to enable near-perfect back buttons with almost zero edge cases, which is very tricky with the older History API. A new PR adds entries() and currentEntry support, and future work plans full-blown navigations with navigation interceptors so framework router implementations can be built wholly on the Navigation API instead of history.pushState/replaceState.

Last shared
01 / The problem

What it addresses

Implementing reliable back buttons with (almost) zero edge cases is surprisingly very tricky with the older History API.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. navigation-ponyfill

    A JavaScript ponyfill for the browser's new Navigation API. It implements navigation.canGoBack and the currententrychange event to enable near-perfect back buttons with almost zero edge cases, which is very tricky with the older History API. A new PR adds entries() and currentEntry support, and future work plans full-blown navigations with navigation interceptors so framework router implementations can be built wholly on the Navigation API instead of history.pushState/replaceState.

    Problem: Implementing reliable back buttons with (almost) zero edge cases is surprisingly very tricky with the older History API.

    Posted by @kcrwfrd_ · Original source ↗

    Source text · @kcrwfrd_ · · Source ↗

    I've been working on a polyfill for the new Navigation API: https://github.com/kcrwfrd/navigation-ponyfill