disable for TBB user agents. closes #37

This commit is contained in:
Serene H 2017-03-01 19:09:24 -08:00
parent 6d2b0ac420
commit 9f2e9a6ecb
2 changed files with 20 additions and 1 deletions

View file

@ -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)