mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Warn when WebRTC isn't detected in the webext
Trac 31067
This commit is contained in:
parent
4494dbd3ca
commit
095f4a0510
5 changed files with 23 additions and 7 deletions
|
@ -3,11 +3,19 @@ const port = chrome.runtime.connect({
|
|||
});
|
||||
|
||||
port.onMessage.addListener((m) => {
|
||||
const active = m.active;
|
||||
const div = document.getElementById('active');
|
||||
const img = div.querySelector('img');
|
||||
const enabled = m.enabled
|
||||
const ps = div.querySelectorAll('p');
|
||||
if (m.missingFeature) {
|
||||
div.querySelector('img').src = "icons/status-off.png";
|
||||
ps[0].innerText = "Snowflake is off";
|
||||
ps[1].innerText = "WebRTC feature is not detected.";
|
||||
ps[1].style.color = 'firebrick';
|
||||
document.querySelector('.toggle').style.display = 'none';
|
||||
return;
|
||||
}
|
||||
const active = m.active;
|
||||
const img = div.querySelector('img');
|
||||
const enabled = m.enabled;
|
||||
const clients = active ? 1 : 0;
|
||||
const enabledText = document.getElementById('toggle');
|
||||
if (enabled) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue