snowflake/proxy/shims.js
David Fifield fdc5563f87 Bug 31126: Use URLSearchParams instead of Query.parse.
This standard interface does the same thing as Query.parse did, with a
different API on the return value. It doesn't have the problems with
keys inherited from Object.prototype that Query.parse did.
2019-07-18 18:29:59 -06:00

31 lines
1 KiB
JavaScript

/* global module, require */
/*
WebRTC shims for multiple browsers.
*/
if (typeof module !== "undefined" && module !== null ? module.exports : void 0) {
window = {};
document = {
getElementById: function() {
return null;
}
};
chrome = {};
location = { search: '' };
({ URLSearchParams } = require('url'));
if ((typeof TESTING === "undefined" || TESTING === null) || !TESTING) {
webrtc = require('wrtc');
PeerConnection = webrtc.RTCPeerConnection;
IceCandidate = webrtc.RTCIceCandidate;
SessionDescription = webrtc.RTCSessionDescription;
WebSocket = require('ws');
({ XMLHttpRequest } = require('xmlhttprequest'));
}
} else {
PeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
IceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate;
SessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription;
WebSocket = window.WebSocket;
XMLHttpRequest = window.XMLHttpRequest;
}