mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Add toggle functionality to web extension
This commit is contained in:
parent
ead579a6e9
commit
799a13d385
5 changed files with 37 additions and 3 deletions
|
@ -4,6 +4,7 @@ All of Snowflake's DOM manipulation and inputs.
|
|||
|
||||
class UI
|
||||
active: false
|
||||
enabled: false
|
||||
|
||||
setStatus: (msg) ->
|
||||
|
||||
|
@ -74,10 +75,17 @@ class WebExtUI extends UI
|
|||
total: @stats.reduce ((t, c) ->
|
||||
t + c
|
||||
), 0
|
||||
enabled: @enabled
|
||||
|
||||
onConnect: (port) =>
|
||||
@port = port
|
||||
port.onDisconnect.addListener @onDisconnect
|
||||
port.onMessage.addListener @onMessage
|
||||
@postActive()
|
||||
|
||||
onMessage: (m) =>
|
||||
@enabled = m.enabled
|
||||
update()
|
||||
@postActive()
|
||||
|
||||
onDisconnect: (port) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue