Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

writable-window-method Version Badge

Build Status License Downloads

Browser tests

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

Uses eslint, see .eslintrc.

About

Turn any window method to a writable state in IE<=8

Resources

License

Packages

No packages published