Skip to content

fix: Regression on browser history due to replaceState proxy#34

Merged
ndungtse merged 3 commits intondungtse:testfrom
zecka:patch-3
Feb 27, 2025
Merged

fix: Regression on browser history due to replaceState proxy#34
ndungtse merged 3 commits intondungtse:testfrom
zecka:patch-3

Conversation

@zecka
Copy link
Contributor

@zecka zecka commented Feb 27, 2025

I made an error on: #32

By appliying same Proxy on pushState en replaceState this cause a regression and create issue on browser history

Because here the proxy is based on history.pushState also for replaceState. ( new Proxy(window.history.pushState, {)

 const proxyStateChange = new Proxy(window.history.pushState, {
        apply: (target, thisArg, argArray: PushStateInput) => {
          stopProgress();
          return target.apply(thisArg, argArray);
        },
      });

window.history.pushState = proxyStateChange;
window.history.replaceState = proxyStateChange;
      

@ndungtse ndungtse self-assigned this Feb 27, 2025
@ndungtse ndungtse changed the base branch from main to test February 27, 2025 16:04
@ndungtse ndungtse merged commit 4f70516 into ndungtse:test Feb 27, 2025
5 checks passed
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.

2 participants