Trying to make browser API match Node