Turbolinks navigation support

The Equo Chromium browser supports detecting client-side navigations triggered by frameworks like Turbolinks, PJAX, and other single-page application (SPA) mechanisms that update the URL without performing a full page reload.

Why is this feature useful?

Client-side routing libraries or AJAX navigation techniques can alter the browser’s address bar without reloading the page. While this improves user experience, it can prevent navigation-related listeners from firing.

These pseudo-navigations often go unnoticed by traditional listeners. Equo Chromium addresses this by providing Turbolinks detection. With this feature enabled, it will notify your application via the standard LocationListener, even when only the URL is changed using JavaScript APIs like history.pushState().

Enabling the feature

Turbolinks support is activated by setting the system property -Dchromium.turbolinks. There are two modes:

  • Basic mode: detect all client-side navigations.

  • Header-filtered mode: detect only requests that include specific HTTP headers.

# Enable full support for client-side navigations
-Dchromium.turbolinks=true

# Only notify when certain headers are present (e.g., PJAX or XHR-specific headers)
-Dchromium.turbolinks="X-PJAX=1;X-Requested-With=XMLHttpRequest;"

Use cases

This feature is recommended when embedding web applications that:

  • Use Turbolinks (e.g., in Rails or Phoenix)

  • Use PJAX or similar JavaScript navigation tools

  • Are SPAs that manipulate browser history via pushState() or replaceState()

Enabling this ensures your Java application remains in sync with what the user sees in the browser.