web-monetization-extension
web-monetization-extension copied to clipboard
Display WM icon differently if website is/isn't monetized
Context
When a user has the WM extension installed, and they have successfully connected their wallet address to the extension, then the icon of the extension must look different depending on whether the user is currently visiting a web monetized website or not.
When a user is visiting a site:
-
If the site has no monetization tag with a valid wallet address url:
-
If the site has at least one monetization tag with a valid wallet address url:
-
If extension has web monetization globally disabled:
Please update the context for us @ionutanin
as @raducristianpopa suggested: we should update the background message handler to use switch case rather than use separate files for each message
We decided to repurpose this ticket, so please disregard any of the comments prior to 10 Apr 2024
Should be ready for peer review on Wed, 17 Apr. Aiming to merge by the end of this week, 19 Apr.
Review feedback shared today. Aiming to resolve and have ready for final merging on Thurs, 2 May.
Issue 1 - PR feedback from Max:
- when WM is globally disabled
- then navigate to a WMized website
- then enable WM globally
- expected behaviour: the WM icon should be updated to show that the site is monetized but currently the WM ext icon appears as though the site is NOT WMized
Secondary issue found:
- the state the that the icon was in on the previously opened tab remains (or is carried over) when a new (blank) tab is opened (this can be confusing as it may appear as WM is active or disabled, or whatever the previously opened site's WM status was).
- still under discussion
Related to Issue 1 above: the WM event is not triggered when re-enabling WM globally. This will be addressed as part of this ticket.