Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Anti-censorship
Pluggable Transports
Snowflake
Commits
9f2e9a6e
Commit
9f2e9a6e
authored
Mar 01, 2017
by
Serene H
Browse files
disable for TBB user agents. closes
#37
parent
6d2b0ac4
Changes
2
Hide whitespace changes
Inline
Side-by-side
proxy/snowflake.coffee
View file @
9f2e9a6e
...
...
@@ -48,7 +48,7 @@ MODE =
WEBRTC_CONNECTING
:
1
WEBRTC_READY
:
2
CONFIRMATION_MESSAGE
=
"
You're currently serving a Tor user via Snowflake.
"
CONFIRMATION_MESSAGE
=
'
You
\
'
re currently serving a Tor user via Snowflake.
'
# Minimum viable snowflake for now - just 1 client.
class
Snowflake
...
...
@@ -222,8 +222,13 @@ snowflakeIsDisabled = ->
if
cookies
[
COOKIE_NAME
]
!=
'1'
log
'Not opted-in. Please click the badge to change options.'
return
true
# Also do nothing if running in Tor Browser.
if
mightBeTBB
()
log
'Will not run within Tor Browser.'
return
true
return
false
###
Entry point.
###
...
...
proxy/util.coffee
View file @
9f2e9a6e
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment