mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -04:00
14 lines
556 B
JavaScript
14 lines
556 B
JavaScript
const port = chrome.runtime.connect({
|
|
name: "popup"
|
|
});
|
|
|
|
port.onMessage.addListener((m) => {
|
|
const active = m.active;
|
|
const div = document.getElementById('active');
|
|
const img = div.querySelector('img');
|
|
img.src = `icons/status-${active ? "on" : "off"}.png`;
|
|
const ps = div.querySelectorAll('p');
|
|
const clients = active ? 1 : 0;
|
|
ps[0].innerText = `${clients} client${(clients !== 1) ? 's' : ''} connected.`;
|
|
ps[1].innerText = `Your snowflake has helped ${m.total} user${(m.total !== 1) ? 's' : ''} circumvent censorship in the last 24 hours.`;
|
|
});
|