-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use proper feature detection in is-supported-example #423
Conversation
Change wallet address to match other examples, removing the .js prefix which could be confusing. Remove deprecated methods for detecting support of a feature in a user agent. Remove DOM query in favor of faster temporary element creation.
✅ Deploy Preview for webmonetization-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
const link = | ||
document.querySelector('link[rel="monetization"]') || | ||
document.createElement('link') | ||
if (link.relList.supports('monetization')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example always bugged me - 3 lines logged
@@ -117,12 +117,9 @@ <h3> | |||
Checking if Web Monetization is supported | |||
</h3> | |||
<p> | |||
There are multiple ways to check if Web Monetization is supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc ?? this file is generated, so you'll want to edit the base file, and then run the respec.sh command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind, this /IS/ the source
https://github.com/WICG/webmonetization/blob/main/src/pages/specification/respec.sh#L21
Prettier was changing the examples to its preferences. The specification should be consistent with other W3C standards' style. https://www.w3.org/community/webed/wiki/Web_Education_community_group_style_guide#Code_standards https://www.w3.org/wiki/Coding_style
The previous instructions did not work after the conversion to Astro, as Astro corrupts the includes and breaks the examples.
81e224a
to
e23b922
Compare
style: disable Prettier in the respec build script docs: update spec local dev instructions to use the build script
Change wallet address to match other examples, removing the .js prefix which could be confusing.
Remove deprecated methods for detecting support of a feature in a user agent.
Remove DOM query in favor of faster temporary element creation.
Tangential issues: