mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Make a few object literals classes
This commit is contained in:
parent
7ce3c83a31
commit
898ba57070
3 changed files with 42 additions and 43 deletions
|
@ -48,18 +48,6 @@ log = (msg) ->
|
|||
|
||||
dbg = (msg) -> log msg if DEBUG or snowflake.ui?.debug
|
||||
|
||||
snowflakeIsDisabled = ->
|
||||
cookies = Parse.cookie document.cookie
|
||||
# Do nothing if snowflake has not been opted in by user.
|
||||
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.
|
||||
|
@ -72,7 +60,7 @@ init = (isNode) ->
|
|||
snowflake = new Snowflake broker, ui
|
||||
|
||||
log '== snowflake proxy =='
|
||||
if snowflakeIsDisabled()
|
||||
if Util.snowflakeIsDisabled()
|
||||
# Do not activate the proxy if any number of conditions are true.
|
||||
log 'Currently not active.'
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue