diff --git a/src/index.js b/src/index.js index 8e2f56a..bc56958 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,16 @@ import { jsdom } from 'jsdom'; +function getWindowPropertyKeys(window) { + return Object + .keys(window) + .concat(Object.keys(window._core)) + .filter(prop => prop.substring(0, 1) !== '_'); +} + const protectedproperties = (() => { const window = jsdom('').defaultView; - return Object - .keys(window) + return getWindowPropertyKeys(window) .filter(prop => global[prop]); })(); @@ -16,8 +22,7 @@ module.exports = (...args) => { const window = jsdom('', jsdomConfig).defaultView; - Object - .keys(window) + getWindowPropertyKeys(window) .filter(prop => protectedproperties.indexOf(prop) === -1) .filter(prop => !(properties && properties.indexOf(prop) === -1)) .forEach(prop => global[prop] = window[prop]);