mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -04:00
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.
31 lines
1 KiB
JavaScript
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;
|
|
}
|