mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
implement snowflake-allow cookie check, messaging for when cookies disabled in options page. close #21
This commit is contained in:
parent
c6b02fdaca
commit
58d2854bbd
2 changed files with 27 additions and 4 deletions
|
@ -77,6 +77,14 @@
|
|||
<div id="snowflake-status"></div>
|
||||
</div>
|
||||
|
||||
<div id='cookies-disabled' style='display:none'>
|
||||
<hr/>
|
||||
<p>
|
||||
Your browser has cookies disabled. You will need to enable them in order
|
||||
to set Snowflake preferences.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
// Defaults to opt-in.
|
||||
|
@ -120,9 +128,16 @@ function refreshStatus() {
|
|||
}
|
||||
}
|
||||
|
||||
$buttons = document.getElementById('buttons');
|
||||
$buttons.style = '';
|
||||
refreshStatus();
|
||||
window.onload = function() {
|
||||
if (navigator.cookieEnabled) {
|
||||
// Both JS and cookies enabled -- display normal buttons.
|
||||
document.getElementById('buttons').style = '';
|
||||
} else {
|
||||
// Display the cookies disabled message if necessary.
|
||||
document.getElementById('cookies-disabled').style = '';
|
||||
}
|
||||
refreshStatus();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue