Comparing version 3.3.1 to 3.3.3
{ | ||
"name": "on-load", | ||
"version": "3.3.1", | ||
"version": "3.3.3", | ||
"description": "On load/unload events for DOM elements using a MutationObserver", | ||
@@ -40,5 +40,5 @@ "main": "server.js", | ||
"devDependencies": { | ||
"browserify": "^13.0.0", | ||
"browserify": "^14.5.0", | ||
"electron-prebuilt": "^0.36.9", | ||
"standard": "^7.1.2", | ||
"standard": "^10.0.3", | ||
"tape": "^4.6.0", | ||
@@ -45,0 +45,0 @@ "testron": "^1.2.0", |
@@ -1,1 +0,9 @@ | ||
module.exports = function () {} | ||
if (isElectron()) { | ||
module.exports = require('./index.js') // explicite relative import to avoid browser field | ||
} else { | ||
module.exports = function () {} | ||
} | ||
function isElectron () { | ||
return window && window.process && window.process.type === 'renderer' | ||
} |
5964
5
101