interledger / web-monetization-extension

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

[FEATURE REQUEST] Preserve monetization state for MPAs #597

Open sidvishnoi opened 2 months ago

sidvishnoi commented 2 months ago

Describe the feature you would like to request

Consider an MPA (read: regular websites) where users spend a short time per page (e.g. web comics), but spend overall enough total time per site. Right now, any navigation on same site leads to monetization status to be reset (as we store state per "document", not per tab/site).

So, essentially, these sites get punished as payment sessions may take a while to start, and user might have navigated away (different page on same site) before next payment starts.

Describe the solution you would like

For navigation in multi-page applications, preserve monetization state and payment sessions as long as the navigation is in the same tab and same website (origin) and the link tags are same (same address and same order).

Additional context

SPAs don't face this problem as they're a single document, and link tags are mostly stable with only the page content changing.