interledger / web-monetization-extension

An open-source browser extension that enables Web Monetization.
Apache License 2.0
49 stars 3 forks source link

Pass latest state when page navigates while popup is open #560

Closed sidvishnoi closed 2 days ago

sidvishnoi commented 3 weeks ago
  1. Visit a monetized website.
  2. Run following to console to simulate background navigation (or a slow navigation - user clicks, user opens popup, site thinking, site navigates):
    setTimeout(() => {window.location.href = "https://another-monetized-website"}, 4000) 
  3. Open popup before above setTimeout callback is called.
  4. Wait for site to be navigated.

The popup still has state from previous site.

This doesn't happen too often in real world, but handling this correctly will help us with https://github.com/interledger/web-monetization-extension/pull/556#issuecomment-2324809958.