Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

2020 11 30

Sid Vishnoi edited this page Jan 14, 2021 · 1 revision

Supported

  • The first link[rel=monetization] element in <head> of document at any time is used.

    • When the href of first such element is modified, the present monetization endpoint is changed.
    • When a link[rel=monetization] element is prepended, it becomes the first tag and the present monetization endpoint is changed.
    • When a link[rel=monetization] element is appended, no change.
    • When all link[rel=monetization] are removed from the document, monetization is stopped.
  • document.createElement("link").relList.supports("monetization") // true

  • monetization-src CSP directive.

  • Only visible tab is monetized.

  • The present implementation for "monetization start" and "monetization stop" is essentially "fetch and log details":

    • Log the current link[rel=monetization].href (Payment URL)
    • Fetch the details at Payment URL with correct HTTP headers (referrer, cache-control, accept) and ensure CORS is respected.
    • Validate the response:
      • ensure correct mime-type and it can be parsed at JSON
      • ensure required fields are present
    • Log the required field values (or, errors, if any) to JS console.

Not supported

  • Monetization link tags in iframes [TODO, IN DISCUSSION: Feature Policy, Multiple tags/streams]
  • Actual monetization and communication of relevant events
  • Link header support [NOT PLANNED]

Known issues/edge cases:

  • Changing the rel attribute value from monetization to something else has no effect (the converse is supported).
  • Need to fix a memory leak when a tab is closed.
Clone this wiki locally