Closed sharon-wang closed 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.
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:
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
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.