@unocode/polyfills
v0.1.1
Published
Your sample OS project
Downloads
2
Readme
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');