mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -04:00
disable for TBB user agents. closes #37
This commit is contained in:
parent
6d2b0ac420
commit
9f2e9a6ecb
2 changed files with 20 additions and 1 deletions
|
@ -5,6 +5,20 @@ Contains helpers for parsing query strings and other utilities.
|
|||
###
|
||||
|
||||
|
||||
# It would not be effective for Tor Browser users to run the proxy.
|
||||
# Do we seem to be running in Tor Browser? Check the user-agent string and for
|
||||
# no listing of supported MIME types.
|
||||
TBB_UAS = [
|
||||
'Mozilla/5.0 (Windows NT 6.1; rv:10.0) Gecko/20100101 Firefox/10.0'
|
||||
'Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0'
|
||||
'Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0'
|
||||
'Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.0'
|
||||
]
|
||||
mightBeTBB = ->
|
||||
return TBB_UAS.indexOf(window.navigator.userAgent) > -1 and
|
||||
(window.navigator.mimeTypes and
|
||||
window.navigator.mimeTypes.length == 0)
|
||||
|
||||
genSnowflakeID = ->
|
||||
Math.random().toString(36).substring(2)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue