index.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright © 2016-2017 Threema GmbH (https://threema.ch/).
  4. This file is part of Threema Web.
  5. Threema Web is free software: you can redistribute it and/or modify it
  6. under the terms of the GNU Affero General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or (at
  8. your option) any later version.
  9. This program is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
  12. General Public License for more details.
  13. You should have received a copy of the GNU Affero General Public License
  14. along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
  15. -->
  16. <html>
  17. <head>
  18. <meta charset="utf-8">
  19. <meta name="viewport" content="width=device-width, initial-scale=1">
  20. <meta name="referrer" content="no-referrer">
  21. <meta name="robots" content="noindex" />
  22. <title>Threema Web Diagnostics</title>
  23. <!-- Favicon -->
  24. <link rel="icon" href="../img/favicon.ico?v=[[VERSION]]" type="image/x-icon"/>
  25. <link rel="shortcut icon" href="../img/favicon.ico?v=[[VERSION]]" type="image/x-icon"/>
  26. <!-- Fonts -->
  27. <link rel="stylesheet" href="../fonts/roboto.css?v=[[VERSION]]" type="text/css">
  28. <link rel="stylesheet" href="../fonts/material.css?v=[[VERSION]]" type="text/css">
  29. <!-- Styling -->
  30. <style>
  31. body {
  32. padding: 16px;
  33. font-family: 'Roboto';
  34. }
  35. #background-image {
  36. min-height: 100%;
  37. min-width: 1024px;
  38. width: 100%;
  39. height: auto;
  40. position: fixed;
  41. top: 0;
  42. left: 0;
  43. z-index: -1;
  44. -moz-user-select: none;
  45. -webkit-user-select: none;
  46. user-select: none;
  47. }
  48. #wrapper {
  49. background-color: white;
  50. margin: 0 auto;
  51. padding: 16px 32px 32px;
  52. min-width: 400px;
  53. max-width: 500px;
  54. text-align: center;
  55. }
  56. #logo {
  57. width: 300px;
  58. color: white;
  59. margin: 0px auto 16px;
  60. }
  61. h1 { margin-top: 0; font-weight: 500; }
  62. h2 { font-weight: 300; }
  63. p { font-weight: 300; }
  64. .status span {
  65. display: inline-block;
  66. line-height: 36px;
  67. vertical-align: top;
  68. }
  69. .status-yes i { color: #4caf50; }
  70. .status-no i { color: #f44336; }
  71. .status-unknown i { color: #0277BD; }
  72. .hidden { display: none; }
  73. .small { font-size: 0.8em; font-weight: 300; }
  74. footer {
  75. color: white;
  76. font-weight: 300;
  77. text-align: center;
  78. padding-top: 16px;
  79. }
  80. </style>
  81. <!-- JS -->
  82. <script src="../node_modules/webrtc-adapter/out/adapter.js?v=[[VERSION]]"></script>
  83. <script>
  84. function switchTo(type, newStatus) {
  85. var unknown = document.querySelector('#status-' + type + ' .status-unknown');
  86. if (unknown) {
  87. unknown.classList.add('hidden');
  88. }
  89. document.querySelector('#status-' + type + ' .status-no').classList.add('hidden');
  90. document.querySelector('#status-' + type + ' .status-yes').classList.add('hidden');
  91. document.querySelector('#status-' + type + ' .status-' + newStatus).classList.remove('hidden');
  92. }
  93. function doChecks() {
  94. // Check for JS
  95. switchTo('js', 'yes');
  96. // Check for RTCPeerConnection
  97. if (window.RTCPeerConnection) {
  98. switchTo('pc', 'yes');
  99. } else {
  100. switchTo('pc', 'no');
  101. }
  102. // Check for RTCDataChannel
  103. if (window.RTCPeerConnection && (new RTCPeerConnection()).createDataChannel) {
  104. switchTo('dc', 'yes');
  105. } else {
  106. switchTo('dc', 'no');
  107. }
  108. // Check for LocalStorage
  109. function localStorageAvailable(){
  110. var test = 'test';
  111. try {
  112. localStorage.setItem(test, test);
  113. localStorage.removeItem(test);
  114. return true;
  115. } catch(e) {
  116. return false;
  117. }
  118. }
  119. if (localStorageAvailable()) {
  120. switchTo('ls', 'yes');
  121. } else {
  122. switchTo('ls', 'no');
  123. }
  124. }
  125. if (document.readyState != 'loading') {
  126. doChecks();
  127. } else {
  128. document.addEventListener('DOMContentLoaded', doChecks);
  129. }
  130. </script>
  131. </head>
  132. <body>
  133. <img src="../img/bg1.jpg?v=[[VERSION]]" id="background-image" draggable="false" alt="" />
  134. <header>
  135. <div id="title">
  136. <div id="logo">
  137. <img src="../img/logo.svg?v=[[VERSION]]" alt="Logo">
  138. </div>
  139. </div>
  140. </header>
  141. <div id="wrapper">
  142. <h1>Threema Web Diagnostics</h1>
  143. <h2>Is JavaScript enabled?</h2>
  144. <div id="status-js">
  145. <div class="status status-no">
  146. <i class="material-icons md-36">error</i> <span class="text">No</span>
  147. </div>
  148. <div class="status status-yes hidden">
  149. <i class="material-icons md-36">check_circle</i> <span class="text">Yes</span>
  150. </div>
  151. </div>
  152. <h2>Is WebRTC available?</h2>
  153. <div id="status-pc">
  154. <div class="status status-unknown">
  155. <i class="material-icons md-36">help</i> <span class="text">Unknown</span>
  156. </div>
  157. <div class="status status-no hidden">
  158. <i class="material-icons md-36">error</i> <span class="text">No</span>
  159. <p class="small">RTCPeerConnection is a part of WebRTC.<br>Threema Web cannot work without it.</p>
  160. </div>
  161. <div class="status status-yes hidden">
  162. <i class="material-icons md-36">check_circle</i> <span class="text">Yes</span>
  163. </div>
  164. </div>
  165. <h2>Are WebRTC DataChannels available?</h2>
  166. <div id="status-dc">
  167. <div class="status status-unknown">
  168. <i class="material-icons md-36">help</i> <span class="text">Unknown</span>
  169. </div>
  170. <div class="status status-no hidden">
  171. <i class="material-icons md-36">error</i> <span class="text">No</span>
  172. <p class="small">RTCDataChannel is a part of WebRTC.<br>Threema Web cannot work without it.</p>
  173. </div>
  174. <div class="status status-yes hidden">
  175. <i class="material-icons md-36">check_circle</i> <span class="text">Yes</span>
  176. </div>
  177. </div>
  178. <h2>Is LocalStorage available?</h2>
  179. <div id="status-ls">
  180. <div class="status status-unknown">
  181. <i class="material-icons md-36">help</i> <span class="text">Unknown</span>
  182. </div>
  183. <div class="status status-no hidden">
  184. <i class="material-icons md-36">error</i> <span class="text">No</span>
  185. <p class="small">Without LocalStorage, persistent sessions and settings<br>cannot be stored in the browser.<br>
  186. See the <a href="https://threema.ch/faq/web_browser_settings">FAQ</a> for information on how to fix this.</p>
  187. </div>
  188. <div class="status status-yes hidden">
  189. <i class="material-icons md-36">check_circle</i> <span class="text">Yes</span>
  190. </div>
  191. </div>
  192. </div>
  193. <footer>
  194. &copy; 2017 Threema GmbH
  195. </footer>
  196. </body>
  197. </html>