Socket
Book a DemoInstallSign in
Socket

dom-shims

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-shims

Shims / polyfills for simple DOM API's missing in not-so-modern browsers.

0.1.4
latest
Source
npmnpm
Version published
Weekly downloads
870
5.71%
Maintainers
1
Weekly downloads
 
Created
Source

dom-shims

Build Status

Sauce Test Status

Complete and well-tested shims / polyfills for various DOM API's missing in not-so-modern browsers.

Installation

npm install --save dom-shims

Apply all the shims by requiring the module without assignment:

require('dom-shims');

Or apply specific shims:

require('dom-shims/shim/CustomEvent');
require('dom-shims/shim/Element.classList');
require('dom-shims/shim/Element.matches');

Features

Event polyfills

  • CustomEvent constructor

Element.prototype shims

NOTES:

  • Ensures all browsers have classList support for SVG elements, multiple-argument support for add and remove, force-argument support for toggle, and correct length and item values even when the class value is mutated by means other than classList.

  • Patches IE 9's implementation, which lacks support for Elements not attached to the document.

Element mutation

DOM Level 4 mutation macros for:

parentNode:
  • Element#append()
  • Element#prepend()
childNode:
  • Element#after()
  • Element#before()
  • Element#remove()
  • Element#replace()

Other shims

Browser support

Intended support for:

  • Chrome
  • Firefox
  • IE9+
  • Safari 6+
  • Android 4+
  • Safari iOS 5.1+
  • Opera

Acknowledgements

Thanks to the following libraries for inspiration, ideas, and workarounds:

Keywords

browser

FAQs

Package last updated on 30 Mar 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.