Skip to content
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

[Monetization flow - Content] - IFrames #233

Closed
dianafulga opened this issue Apr 18, 2024 · 4 comments · Fixed by #241
Closed

[Monetization flow - Content] - IFrames #233

dianafulga opened this issue Apr 18, 2024 · 4 comments · Fixed by #241
Assignees
Labels
area: background Improvements or additions to extension background script

Comments

@dianafulga
Copy link
Contributor

dianafulga commented Apr 18, 2024

When a web monetized website contains iframes, the WM extension inspects only the header of an iframe for the monetization tag and its wallet address. The extension does not inspect nested iframes for the monetization tag.

If there are multiple iframes within the main frame, the extension still only inspects the header of the iframe, and disregards its body or any nested iframes.

Based on the above, the extension evenly splits the amount it pays to a WMized website between the number of wallets identified for monetization:

  • If a website has 1 monetization tag (and wallet) in its primary frame, and it also has 3 distinct iframes that each have a monetization tag (and wallet address) in their header, then the extension evenly splits the WM payment between a total of 4 WM wallet addresses (i.e. one to the wallet in the primary frame, and one to each wallet of each of the 3 iframes)
  • The extension disregards anything other than the first monetization tag and wallet in the header of an iframe. So, if there are multiple WM tags/wallets in the header of an iframe, the extension only inspects the first one, and disregards the rest.
  • If an iframe has a monetization tag anywhere other than the header, the ext. also disregards those.
  • If there are nested iframes, definitely disregard them.
@dianafulga dianafulga self-assigned this Apr 18, 2024
@tselit
Copy link

tselit commented Apr 18, 2024

The majority of this work will be more about testing.
We're anticipating covering the following test scenarios, to get ready for alpha:

  • page with single iframe (then with one or multiple wallet addresses in the one iframe...and so on for the test scenarios listed below)
  • page with multiple iframes nested
  • page with multiple iframes not nested

Aiming to put into review tomorrow (19 April), ahead of work-week in Cluj.

@tselit
Copy link

tselit commented Apr 24, 2024

Decided on 24 April that to handle limiting the scope for the alpha build as follows:

  • Only evaluate/inspect the first link tag we encounter in the iframe.
  • If the first tag is invalid, then stop any further evaluation.
  • Keep track of the validity of the first link tag.

@tselit tselit added the area: background Improvements or additions to extension background script label May 2, 2024
@tselit tselit linked a pull request May 2, 2024 that will close this issue
@tselit tselit added this to the WM extension 1.0.0-alpha milestone May 9, 2024
@dianafulga
Copy link
Contributor Author

dianafulga commented May 9, 2024

The current implementation is using postMessage to all domains, which may imply that some site that have they have an event listener will intercept it and might impact their site (for example: an website can refresh the page if it receives an unknown
message)
There is another possible solution, much more complicated solution, using the background as a middle man to retrieve the frameId.

@tselit
Copy link

tselit commented May 16, 2024

What remains is to implement the following (estimate 8 hrs to have this ready for review): ensuring that the WM icon display is correctly updated when a website has iframes, including when a website is not monetized but it does have a monetized iframe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: background Improvements or additions to extension background script
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants