Skip to content

Commit

Permalink
iframes (#53)
Browse files Browse the repository at this point in the history
* iframes

* phrasing

* multi-frames

Updated iframes section based on Matt and Ben's feedback.

* nesting-supported

removed note about nested iframes being unsupported

Co-authored-by: Melissa Henderson <57110301+MelAtCoil@users.noreply.github.com>
  • Loading branch information
melissahenderson and melissahenderson committed Apr 22, 2020
1 parent d32f527 commit d38e119
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/api.md
Expand Up @@ -254,3 +254,16 @@ the `requestId` in the `monetizationstart` browser event.
```http
Web-Monetization-Id: dcd479ad-7d8d-4210-956a-13c14b8c67eb
```

## Iframes
You can monetize an iframe by adding `monetization` to the iframe's `allow` attribute. For example:

```html
<iframe src = "/wm/example.htm" width = "600" height = "800" allow="monetization">
```

The iframe must have the `meta` tag in its `head` in order to monetize. In the example above, `example.htm` contains the Web Monetization `meta` tag. No errors will occur from embedding a non-monetized iframe with `allow="monetization"`.

The `allow` attribute continues to support multiple permissions when using `monetization`. For example, `<...allow="monetization; fullscreen">`.

If the parent page contains the Web Monetization `meta` tag and multiple monetized iframes, then payment is split between all monetized frames. Whether the payment is split evenly is a matter of payment rate. Coil, for example, splits payments evenly; however, the standard doesn't require providers to do so.

0 comments on commit d38e119

Please sign in to comment.