fixed crash in environments which don't have the 'navigator' object (e.g. vows/NodeJS)