mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
provide 'silent' param on snowflake proxy to disable confirmation dialog
This commit is contained in:
parent
91673a4abe
commit
39be8403a4
2 changed files with 11 additions and 1 deletions
|
@ -14,6 +14,7 @@ DEFAULT_RELAY =
|
|||
COPY_PASTE_ENABLED = false
|
||||
|
||||
DEBUG = false
|
||||
silenceNotifications = false
|
||||
query = null
|
||||
if 'undefined' != typeof window && window.location
|
||||
query = Query.parse(window.location.search.substr(1))
|
||||
|
@ -190,6 +191,7 @@ dbg = (msg) -> log msg if true == snowflake.ui.debug
|
|||
|
||||
init = ->
|
||||
ui = new UI()
|
||||
silenceNotifications = Params.getBool(query, 'silent', false)
|
||||
brokerUrl = Params.getString(query, 'broker', DEFAULT_BROKER)
|
||||
broker = new Broker brokerUrl
|
||||
snowflake = new Snowflake broker, ui
|
||||
|
@ -205,7 +207,7 @@ init = ->
|
|||
# Notification of closing tab with active proxy.
|
||||
# TODO: Opt-in/out parameter or cookie
|
||||
window.onbeforeunload = ->
|
||||
if MODE.WEBRTC_READY == snowflake.state
|
||||
if !silenceNotifications && MODE.WEBRTC_READY == snowflake.state
|
||||
return CONFIRMATION_MESSAGE
|
||||
null
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue