mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
21 lines
590 B
CoffeeScript
21 lines
590 B
CoffeeScript
###
|
|
WebrTC shims for multiple browsers.
|
|
###
|
|
|
|
if typeof module isnt 'undefined' and module.exports
|
|
window = {}
|
|
else
|
|
window = this
|
|
prop = Modernizr.prefixed 'RTCPeerConnection', window, false
|
|
if not prop
|
|
console.log 'webrtc feature not detected. shutting down'
|
|
return
|
|
|
|
PeerConnection = window[prop]
|
|
|
|
### FIXME: push these upstream ###
|
|
IceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate
|
|
SessionDescription = window.RTCSessionDescription ||
|
|
window.mozRTCSessionDescription
|
|
|
|
location = if window.location then window.location.search.substr(1) else ""
|