make it workig across node-webkit contexts