Don't overwrite global location

This commit is contained in:
Arlo Breault 2019-07-07 10:30:19 +02:00
parent 3455cd5da8
commit 6e95581f53
2 changed files with 2 additions and 5 deletions

View file

@ -13,7 +13,7 @@ var snowflake, query, debug, silenceNotifications, log, dbg, init;
snowflake = null;
query = Query.parse(location);
query = Query.parse(location.search.substr(1));
debug = Params.getBool(query, 'debug', false);

View file

@ -10,7 +10,7 @@ if (typeof module !== "undefined" && module !== null ? module.exports : void 0)
}
};
chrome = {};
location = '';
location = { search: '' };
if ((typeof TESTING === "undefined" || TESTING === null) || !TESTING) {
webrtc = require('wrtc');
PeerConnection = webrtc.RTCPeerConnection;
@ -20,9 +20,6 @@ if (typeof module !== "undefined" && module !== null ? module.exports : void 0)
({ XMLHttpRequest } = require('xmlhttprequest'));
}
} else {
document = window.document;
chrome = window.chrome;
location = window.location.search.substr(1);
PeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
IceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate;
SessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription;