Handle origin with port numbers correctly
Fix utils.getOrigin for file:// urls