Skip to content

Conversation

@antedeguemon
Copy link

@antedeguemon antedeguemon commented Oct 3, 2025

Hello, folks! 🖖

This pull request addresses #1. It adds support for the Navigation API, and preferably uses it when available.

flowchart TD
    Start([onNavigate called]) --> CheckHijacked{historyHijacked?}
    
    CheckHijacked -->|true| AddCallback[Add callback to set]
    CheckHijacked -->|false| TryNav[Try hookNavigation]
    
    TryNav --> NavCheck{Navigation API<br/>available?}
    
    NavCheck -->|Yes| UseNav[Use window.navigation<br/>addEventListener]
    NavCheck -->|No| UseHistory[Use hookHistory]
    
    UseNav --> SetFlag1[Set historyHijacked = true]
    UseHistory --> HijackMethods[Hijack pushState<br/>& replaceState]
    HijackMethods --> SetFlag2[Set historyHijacked = true]
    
    
    style UseNav fill:#90EE90
    style UseHistory fill:#FFB6C1
    style SetFlag1 fill:#87CEEB
    style SetFlag2 fill:#87CEEB
Loading

Closes #1 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use navigation.onnavigate when available?

1 participant