使用Web货币化API来娱乐和获利
Using the Web Monetization API for fun and profit

原始链接: https://blog.tomayac.com/2025/11/07/using-the-web-monetization-api-for-fun-and-profit/

## Web Monetization:可持续出版的新途径 作者最近在JSConf墨西哥探讨了Web Monetization,并与Interledger基金会讨论了它的潜力。这项新兴标准旨在为出版商提供多样化的收入来源——从一次性捐款到持续的按浏览付费模式——同时为受众提供直接支持内容创作者的方式。 用户可以通过安装浏览器扩展程序、连接基于法定货币的钱包(如USD或EUR的GateHub——*加密货币不可用*)以及浏览已实现货币化的网站(扩展程序中显示为绿色复选标记)来参与。付款会“流式传输”实时进行,可在DevTools中查看。 出版商只需在页面中添加``标签,并填写其钱包的支付指针即可。JavaScript API允许根据用户贡献动态更改内容——例如移除广告或解锁内容。 原生Web Monetization代码已经在Chromium中进行测试,由Interledger基金会资助。作者认为这项标准对于Web出版的财务可持续性未来具有重要意义。

最近的 Hacker News 讨论集中在 Web Monetization API 上,该标准允许用户通过“流式”支付模式直接为网站内容付费。虽然用户可以控制支付金额(按小时或一次性),但有人担心缺乏标准化的支付处理和跨钱包兼容性。 目前,可用的钱包似乎在向其他钱包发送支付方面能力有限,这可能会限制支付选项。一位评论者戏称需要主动管理浏览器标签页以避免意外的持续支付。 另一位用户对该 API 的实用性表示怀疑,认为内容创作者*和*钱包提供者都需要广泛实施。这场讨论凸显了这种新的网页货币化方法的潜力以及当前局限性。
相关文章

原文

I recently spoke at JSConf Mexico, where spent a lot of time with the Interledger Foundation folks in the hallway track and at the after party events, namely with Ioana (Eningeering Manager) and Marian (DevRel) to talk about Web Monetization.

Web Monetization gives publishers more revenue options and audiences more ways to sustain the content they love. Support can take many forms: from a one-time contribution to a continuous, pay-as-you-browse model. It all flows seamlessly while people engage with the content they love. Publishers earn the moment someone engages, while audiences contribute in real time, using a balance they control.

I encourage you all to give it a try! Install the extension that polyfills the proposed Web standard, get a wallet (I went with GateHub, which works in US Dollars and Euros), and then connect it to the extension.

You need to have funds in EUR (€) or USD ($). If you have crypto, it won't work, which I've found out by trial and error, as I was part of Coil, the Web Monetization predecessor, which paid out in XRP.

Just to clarify, while you need a wallet—that typically is used for crypto—the actual transactions are all in real fiat money, Euro in my case.

As an extension user

Connect your wallet, and browse to a page that supports Web Monetization. You will notice whether a page is monetized when the extension has a green checkmark. My blog happens to be monetized.

The Web Monetization extensions's popup window.

You can adjust how much you want to pay the site per hour and also send one-time payments. The money is "streamed" every minute, which you can observe in DevTools.

Chrome DevTools Network tab showing a POST request for a payment.

We actually have code in Chromium to make native Web Monetization happen, implemented by Igalia and funded by the Interledger Foundation. I hope they can share the experiment results soon.

As a publisher

On your page, add a payment link. You get the personalized payment pointer from your wallet. The following snippet shows mine.

<link rel="monetization" href="https://ilp.gatehub.net/348218105/eur" />

Then you're ready to receive payments. Here's me browsing my blog and seeing payments go out from and come in to my GateHub wallet. This is of course effectively a zero sum game, me paying myself. The 0.01 cent are the streamed payments that go out and then come in again. I tested a one-time payment as well. The 0.50 cents (not shown) was a successful one-time payment.

The GateHub wallet showing incoming and outgoing transactions.

There's also a JavaScript API, so you can adjust the content of your page when your page notices that the user is paying.

window.addEventListener('monetization', (event) => {
  const { value, currency } = event.amountSent;
  console.log(`Browser sent ${currency} ${value}.`);
  const linkElem = event.target;
  console.log('for link element:', linkElem, linkElem.href);
});

For testing purposes, you can observe these monetization events in Chrome DevTools by pasting in the snippet above in the Console.

Chrome DevTools Console showing a  event.

This way you could, for example, remove ads, or unlock an article when you notice a one-time payment. On my blog, I just show a "thank you" message for now.

Thank you message in the footer of my blog showing how much the user has paid.

I'm really bulli$h on this proposed standard. Hopefully someone else will try it and let me know how it goes. I truly and honestly believe that this could be the future for making the Web of tomorrow financially sustainable for publishers, big and small.

联系我们 contact @ memedata.com