0.1.1 • Published 6 years ago

@unocode/polyfills v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

UnoCode Polyfills (UnoPolyfills)

Simulate IE behavior on newer browsers.

Instalation

You can install UnoPolyfills via npm:

npm install --save @unocode/polyfills

Usage

import UnoPolyfills from '@unocode/polyfills';

const polyfills = new UnoPolyfills();

polyfills.fix_document_getElementById();
polyfills.fix_window_open();
polyfills.fix_window_show_modal_dialog();

Using original methods after polyfills replaced them

UnoPolyfills save the original methods, so you can easily use them after you replaced them:

import UnoPolyfills from '@unocode/polyfills';

const polyfills = new UnoPolyfills();

// Overrides getElementById() behavior.
polyfills.fix_document_getElementById();

// Runs with new behavior
document.getElementById('my-id');

// Runs original method (without polyfill)
polyfills.replaced.getElementById('my-id');