Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
domtokenlist
Advanced tools
Readme
Enables support for the DOMTokenList interface in IE8-9, and fixes buggy implementations in newer browsers.
npm install domtokenlist
component install Alhadis/DOMTokenList
This polyfill works at feature-level, meaning it doesn't identify shortcomings based on browser vendor or version (though I'm hoping that's common sense to most developers these days).
Include svg-fix.js
before the main polyfill if you're working with SVG elements.
For modularity's sake, I've isolated all SVG-specific fixes to their own file.
They might, but so far, every one I've encountered has issues working with both the classList
and className
attributes simultaneously.
For example, assume the following scenario:
<!DOCTYPE html>
<html class="bar">
<script>
var root = document.documentElement;
var rootClasses = root.classList;
console.log(rootClasses[0]); // Outputs "bar", as expected
root.className = "foo " + root.className;
console.log(rootClasses[0]); // Outputs "bar" instead of "foo"
</script>
This is an edge case, but expecting developers to avoid the .className
attribute as well as direct references to token-lists (which might be done for brevity's sake) wasn't enough to satisfy me. I wanted a true, transparent, lightweight and dynamic polyfill for the interface I loved so much.
FAQs
Enables support for the DOMTokenList interface in IE8-9, and fixes buggy implementations in newer browsers.
We found that domtokenlist demonstrated a not healthy version release cadence and project activity because the last version was released 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).