-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] iframe allow="monetization" #82
Comments
Thanks for opening this bug @thejustinwalsh! Looks like we missed this in the WM API docs. We'll need to check for iframes that include I've added this issue into our upcoming milestone. |
Here's some docs on iframes that are relevant: https://www.w3schools.com/howto/howto_js_element_iframe.asp We can use this to get the monetization meta tag inside an iframe. |
Doing some research, here's what I've found. What does the spec say about iframes?There is a conflict between what the W3C Web Monetization Spec, webmonetization.org, and the Interledger rfcs say about monetization tags inside src pages of iframes. The W3C spec and the Interledger rfcs say (This line added to the rfcs on July 11 2019):
But webmonetization.org says (this line added on April 22 2020):
Going by the blame dates listed above in parentheses, the info that monetization tags inside src pages of iframes are allowed seems to be more up-to-date. However, confusingly, the interledger rfcs used to match webmonetization.org in iframes info, but were later updated to say iframes are not allowed. Can I access the contents of an iframe using a content-script?When I try to programmatically access the meta tag in the iframe on https://defold.itch.io/climberz by running The Coil extension may work around this problem by getting the Going to try to see how they do it in the Coil Extension Source |
This appears to be the PR where iFrames are implemented in the coil extension |
Thanks @thejustinwalsh ! I found what looks to be a solution to the problem of accessing iframe contents in this stackoverflow thread: https://stackoverflow.com/questions/11325415/access-iframe-content-from-a-chromes-extension-content-script. It says that we can add a flag to our manifest which tells chrome to run our content script in iframes as well. Once we have a content script running in an iframe, we can then communicate with the top level page's content script (the page that contains the iframe) through our background script. This adds a bit of complexity but it's not too bad, I'm confident this should work! |
I think monetization with iframes was always allowed, but the form in which they can be monetized has evolved. I don't think there's a conflict between the specs, as iframes can be monetized, it's just that iframes themselves do not contain the monetization meta tag. Previously, you could add a monetization meta tag within an iframe, but now the meta tag itself must only be set within the parent window of the iframe. If you want to monetize an iframe, you need to add
More examples of iframe monetization from the PR Justin linked: https://github.com/coilhq/web-monetization-projects/pull/415/files#diff-35ab4e71562e0cae7163e828dbb4369ee41eb76372b70fc9d282ff78ca6620da |
I've updated my comment above to make my use of language more clear. @sharon-wang and I discussed and we have decided that the webmonetization.org spec is the most up-to-date, and we will follow it over other specs. Based off the webmonetization.org spec, monetization tags inside src pages of iframes is allowed as long as the iframe has the allow="monetization" attribute. @sharon-wang and I have decided on a simple design for tracking payments and time spent, taking into account iframes:
In summary, users only care about whether time spent at an origin is monetized or not. As such, iframes contribute to the top-level page's decision on whether the page's origin is currently monetized or not. Additionally, if users with a provider send payments to a payment pointer in an iframe, this is tracked using the |
@thejustinwalsh this is fixed! Let us know if you have any troubles or comments! :) |
Awesome, pulling and updating now! Amazing work! |
Working like a charm! Thanks again! |
Describe the bug
When visiting sites that have content in an iframe with allow="monetization" set Akita does not track the payments being streamed, or that the page supports monitization.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Tracking of web monetization in iframes per:
https://webmonetization.org/docs/api/#iframes
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: