writable-window-method
v1.0.3
Published
Turn any window method to a writable state in IE<=8
Downloads
3,448
Readme
writable-window-method
Turn any window property to a writable state in IE <= 8.
npm install writable-window-method --save[-dev]
Example
var writable = require('writable-window-method');
writable([
'XMLHttpRequest',
'Date',
'setTimeout'
]);
function XMLHttpRequest() {
console.log('Owned');
}
var noNative = new XMLHttpRequest();
// 'Owned'
var xhr = new writable.original.XMLHttpRequest();
// a real XMLHttpRequest instance
API
writable([propNames, ..])
Pass an array of property names to make them writable. This does not change the behavior of the original properties, it just make them writable for you.
writable.original.propName
Access the original window.propName
you made writable just before.
writable.restore()
Restore all writable properties to their original versions.
Populated with every new XMLHttpRequest()
or new XDomainRequest()
.
All requests have the original properties/methods from the spec.
We also added a couple of handy properties/methods for you to ease testing.
Development
npm run dev
Go to http://localhost:8080/__zuul.
Tests are written with tape and run through zuul.
Lint
npm run lint