esse-dev / akita

A browser extension that gives you insight into your engagement with Web Monetization.
Other
24 stars 3 forks source link

[BUG] Akita not detecting monetization in Firefox #120

Closed sharon-wang closed 3 years ago

sharon-wang commented 3 years ago

Describe the bug In Firefox only, Akita seems to not be detecting Web-Monetized sites, as the browser icon does not change to reflect that a site is monetized and top site data is not being stored.

To Reproduce Steps to reproduce the behavior:

  1. Install Akita in Firefox
  2. Go to a Web-Monetized site
  3. Observe that the Akita icon does not change and no top site data is shown

Expected behavior The Akita icon should change to the monetized state and top site data should show up in the extension popup after visiting a Web-Monetized site.

Screenshots image

Desktop:

Additional context Monetization detection was working on Firefox at one point, but we haven't been diligent about testing on Firefox. We haven't tested on Firefox for the last couple of Chrome releases, so the problem could be from a ways back.

We started injecting a script onto the page to help us manage listening to monetization events. It seems like this could be where things are going wrong for Firefox, but more investigation is needed.

vezwork commented 3 years ago

There is a workaround if it is in-fact the case that the code injection is not working as expected. We can listen to monetization events on the window object of the page in the content script instead of injecting a script, which is necessary to listen to monetization events on the document.monetization object. Even though it's simpler to listen to events on window and it does the same thing as listening on the document.monetization object in practice, we don't currently do it because it is not part of the Web Monetization spec so it could stop working at any time.