Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@webreflection/custom-elements-builtin
Advanced tools
Readme
Social Media Photo by Joanna Kosinska on Unsplash
A better custom-elements-builtin polyfill, targeting Safari, but working in every other browser that has native customElements.
This module is included in @ungap/custom-elements polyfill, use that to avoid dealing with try
catches manually, it features detect everything for you.
Do not use this module directly unless you are targeting Safari/WebKit browsers only.
I am not maintaining how to feature detect in here, because it keeps changing, and the right polyfill that includes most updated feature detection is this one, not this module.
If you'd like your builtin elements to be style-able, and you land these elements through their constructors or via document.createElement('button', {is: 'custom-button'})
, remember to explicitly set their is
attribute, because due to this inconsistent bug, Chrome and Firefox don't do that automatically, and your builtin extends might not get the desired style.
class BlueButton extends HTMLButtonElement {
constructor() {
super()
// for dedicated styles, remember to do this!
this.setAttribute('is', 'blue-button');
// everything else is fine
this.textContent = 'I am blue';
}
}
customElements.define('blue-button', BlueButton, {extends: 'button'});
document.body.appendChild(new BlueButton);
This polyfill does that automatically because all builtin extends must be query-able via querySelectorAll
, but other browsers won't do that automatically.
FAQs
A better custom-elements-builtin polyfill, Safari only
The npm package @webreflection/custom-elements-builtin receives a total of 813 weekly downloads. As such, @webreflection/custom-elements-builtin popularity was classified as not popular.
We found that @webreflection/custom-elements-builtin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.