Search code examples
htmlmeta-tags

Embedding Web Monetization in hosted platforms


Reading up on Web Monetization, I came across the method of using a meta tag to enable accepting payment.

<meta name="monetization" content="$YourPaymentPointer" />

Would there be a way to take advantage of a hosting platform (such as Github) to accept payments via the meta tag? For instance, I was wondering what would happen if I embedded the meta tag in, say, a markdown file, or even in this SO post. It seems like this would prove to be a problem for Web Monetization in general.

Is it true that web monetization will only work if the meta tag is in the <head> section?

If you edit this post, you will see that I have embedded a meta tag like the one quoted above to show what I mean.


Solution

  • Anywhere you can embed arbitrary meta tags (like, say, <meta http-equiv="refresh" />) is probably somewhere where the page generally represents content you control.

    So on Github Pages you probably could put your own Web Monetization tag, and maybe in a project README, but embedding it in comments would be unlikely to work unless other meta tags are allowed there. If you examine the source, you'll see that Stack Overflow has cleverly removed your meta tag from the rendered HTML.

    The spec also requires that:

    The Tags Set MUST be in the head of the document.

    So any page that has it elsewhere isn't to spec, and any client implementation that accepts it there is being more permissive than the spec thinks it should be.