使用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出版的财务可持续性未来具有重要意义。

## Web Monetization API 讨论总结 最近的 Hacker News 讨论围绕 Web Monetization API,这是一种让创作者在用户主动浏览内容时接收小额支付的方式。该 API 使用网页上的 `` 元素来指定支付指针。 虽然前景可观,但采用方面面临障碍。主要担忧包括交易成本(尤其是在 XRP 之外),如果标签页保持打开状态可能造成的意外支出,以及对用户账户/钱包的需求。用户担心控制支付金额和追踪资金去向。 该 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