Closed marcoscaceres closed 4 years ago
Yeah, I'm not sure. I wasn't really around for the beginnings of the spec, but I do recall reading some discussion when starting up. Tracked it down to here: https://github.com/interledger/rfcs/pull/500#discussion_r245246937
And here: https://github.com/interledger/rfcs/pull/500#issuecomment-452932589 And: https://github.com/interledger/rfcs/pull/500#issuecomment-453173372
To quote @justmoon from comments above:
To give some context: This made more sense to me because Web Monetization is now triggered by a meta-tag and meta-tags describe the document. So whereas previously it was a feature of the JavaScript environment (hence existing on window, it's now a feature of the HTML document.
The decision about where to put this was not strongly sided either way. If it's better as a stand-alone global then let's make it a global.
Yes, putting something in the global namespace would be my preference.
@marcoscaceres Curious as to why that is. Is that just the prevailing convention, or you have a rationale? or both?? :)
Is that just the prevailing convention, or you have a rationale? or both?? :)
Bit of both... we generally like to put things on the document that directly affect the Document. You can see what I mean by looking at the interface definition:
https://html.spec.whatwg.org/#the-document-object
In most cases, the methods and attributes affect the Document directly in some meaningful way. Monetization doesn't affect the Document or reflect some sate of the document, so should probably not be hung on that interface.
Thanks again for the info :)
Kamino closed and cloned this issue to interledger/webmonetization.org
Wondering what the rationale was for attaching monetization to the
Document
object? It doesn't really feel like the right place to attach this, as monetization doesn't itself affect the document or have anything specifically to do with the document interface. We should consider maybe having monetization either on Navigator or its ownMonetization
namespace.