Fixed detecting code for browser/Node/NodeWebkit.