Skip to content

Polyfill the Web Monetization JavaScript API on document.monetization

License

Notifications You must be signed in to change notification settings

immers-space/web-monetization-polyfill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-monetization-polyfill

npm

Polyfill the Web Monetization JavaScript API on document.monetization

Why

The Coil browser extension will typically load the polyfill for you, but, if you're serving your page with a Content Security Policy, the extension will be unable to inject the polyfill script.

In that case, you'll want to provide the web-monetization-polyfill yourself.

Usage

Install: npm install web-monetization-polyfill

Source: require('web-monetization-polyfill')

While you could, in theory, source this from a CDN in a script tag, you'd have to open up your CSP to allow it, so this method is not recommended. If you must, you'll need to add the current hash to your script-src directive.

Compatibility

web-monetization-polyfill Coil browser add-on
2.0.0 0.0.52

Copyright

Copyright for the original source for the polyfill belongs to Coil

About

Polyfill the Web Monetization JavaScript API on document.monetization

Resources

License

Stars

Watchers

Forks

Packages

No packages published