|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html> |
3 | | - <head> |
4 | | - <meta charset="utf-8"/> |
5 | | - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
6 | | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
7 | | - |
8 | | - <link rel="stylesheet" href="styles.css" /> |
9 | | - <script src="webxdc.js"></script> |
10 | | - <script src="js/utils.js"></script> |
11 | | - </head> |
12 | | - <body> |
13 | | - <div class="card" id="cookies-output"></div> |
14 | | - <script src="js/cookies.js"></script> |
| 3 | + <head> |
| 4 | + <!-- Putting this inline and at the top level |
| 5 | + so that it gets executed as early as possible. |
| 6 | + Same in iframe-webrtc-test.html --> |
| 7 | + <script> |
| 8 | + globalThis.__capturedWebRTCObj = RTCPeerConnection; |
| 9 | + </script> |
15 | 10 |
|
16 | | - <div class="card" id="storage-output"></div> |
17 | | - <script src="js/storage.js"></script> |
| 11 | + <meta charset="utf-8" /> |
| 12 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> |
| 13 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
18 | 14 |
|
| 15 | + <link rel="stylesheet" href="styles.css" /> |
| 16 | + |
| 17 | + <!-- debugging --> |
| 18 | + <script src="js/eruda.min.js"></script> |
| 19 | + <script> |
| 20 | + eruda.init(); |
| 21 | + </script> |
| 22 | + |
| 23 | + <script src="webxdc.js"></script> |
| 24 | + <script src="js/utils.js"></script> |
| 25 | + </head> |
| 26 | + <body> |
| 27 | + <div class="pages"> |
| 28 | + <div |
| 29 | + class="page active" |
| 30 | + id="page-webxdc" |
| 31 | + role="tabpanel" |
| 32 | + aria-labelledby="tab-webxdc" |
| 33 | + > |
| 34 | + <div class="card" id="realtime-output"></div> |
| 35 | + <script src="js/realtime.js"></script> |
19 | 36 | <div class="card" id="uploads-output"></div> |
20 | 37 | <script src="js/uploads.js"></script> |
21 | | - |
22 | 38 | <div class="card" id="import-export-output"></div> |
23 | 39 | <script src="js/import-export.js"></script> |
| 40 | + <div class="card" id="update-api-output"></div> |
| 41 | + <script src="js/update-api.js"></script> |
24 | 42 |
|
25 | | - <div class="card" id="links-output"></div> |
26 | | - <script src="js/links.js"></script> |
| 43 | + <div class="card"> |
| 44 | + <header class="container"><h2>Webxdc Status Update Tests</h2></header> |
| 45 | + <div class="container"> |
| 46 | + <a href="./duplicated_updates_race.html"> |
| 47 | + Duplicated Status Updates Race Test |
| 48 | + </a> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + |
| 52 | + <div class="card" id="webxdc-notify-output"></div> |
| 53 | + <script src="js/webxdc-notify.js"></script> |
27 | 54 |
|
| 55 | + <div class="card" id="info-output"></div> |
| 56 | + <script src="js/info.js"></script> |
| 57 | + </div> |
| 58 | + <div |
| 59 | + class="page" |
| 60 | + id="page-web-api" |
| 61 | + role="tabpanel" |
| 62 | + aria-labelledby="tab-web-api" |
| 63 | + > |
| 64 | + <div class="card" id="storage-output"></div> |
| 65 | + <script src="js/storage.js"></script> |
28 | 66 | <div class="card" id="unload-output"></div> |
29 | 67 | <script src="js/unload.js"></script> |
30 | | - |
31 | 68 | <div class="card" id="navigator-output"></div> |
32 | 69 | <script src="js/navigator.js"></script> |
33 | 70 |
|
34 | | - <div class="card" id="update-api-output"></div> |
35 | | - <script src="js/update-api.js"></script> |
36 | | - |
37 | 71 | <div class="card" id="races-output"></div> |
38 | 72 | <script src="js/races.js"></script> |
39 | 73 |
|
40 | 74 | <div class="card" id="wasm-output"></div> |
41 | 75 | <script src="js/wasm.js"></script> |
42 | 76 |
|
| 77 | + <div class="card" id="links-output"></div> |
| 78 | + <script src="js/links.js"></script> |
| 79 | + </div> |
| 80 | + <div |
| 81 | + class="page" |
| 82 | + id="page-sandbox" |
| 83 | + role="tabpanel" |
| 84 | + aria-labelledby="tab-sandbox" |
| 85 | + > |
| 86 | + <div class="card" id="cookies-output"></div> |
| 87 | + <script src="js/cookies.js"></script> |
| 88 | + <div class="card" id="camera-access"></div> |
| 89 | + <script src="js/media-access.js"></script> |
| 90 | + |
43 | 91 | <iframe id="iframe-regular" style="display: none"></iframe> |
44 | | - <iframe id="iframe-allow-same-origin" sandbox="allow-same-origin" style="display: none"></iframe> |
| 92 | + <div id="iframe-container" style="display: none"></div> |
| 93 | + <iframe |
| 94 | + id="iframe-allow-same-origin" |
| 95 | + sandbox="allow-same-origin" |
| 96 | + style="display: none" |
| 97 | + ></iframe> |
45 | 98 | <div class="card" id="webrtc-output"></div> |
46 | | - <script src="js/webrtc.js"></script> |
47 | | - <iframe src="./iframe-webrtc-test.html" sandbox="allow-scripts" width="100%" height="200"></iframe> |
48 | | - |
49 | 99 | <div class="card"> |
50 | | - <header class="container"><h2>Webxdc Status Update Tests</h2></header> |
51 | | - <div class="container"> |
52 | | - <a href="./duplicated_updates_race.html"> |
53 | | - Duplicated Status Updates Race Test |
54 | | - </a> |
55 | | - </div> |
| 100 | + <header class="container"> |
| 101 | + <h2>webrtc-sidechannel iframe</h2> |
| 102 | + </header> |
| 103 | + <script src="js/webrtc.js"></script> |
| 104 | + <iframe |
| 105 | + src="./iframe-webrtc-test.html" |
| 106 | + sandbox="allow-scripts" |
| 107 | + width="100%" |
| 108 | + height="200" |
| 109 | + ></iframe> |
56 | 110 | </div> |
57 | 111 |
|
58 | | - <!-- debugging --> |
59 | | - <script src="js/eruda.min.js"></script> |
60 | | - <script>window.addEventListener("load", () => eruda.init());</script> |
61 | | - </body> |
| 112 | + <div class="card" id="iframe-output"></div> |
| 113 | + <script src="js/iframe.js"></script> |
| 114 | + |
| 115 | + <!-- DNS prefetch check, originally developed by Cure53 |
| 116 | + and distributed as "Cure53 Test App - DNS checker" app. |
| 117 | + See https://delta.chat/en/2023-05-22-webxdc-security#dns-prefetching-marks-another-exploit. --> |
| 118 | + <div class="card dns-prefetch-output"> |
| 119 | + <header class="container"> |
| 120 | + <h2>DNS Prefetch</h2> |
| 121 | + </header> |
| 122 | + <div class="container"> |
| 123 | + <section> |
| 124 | + <p>Usage instructions:</p> |
| 125 | + <ol> |
| 126 | + <li> |
| 127 | + Navigate to |
| 128 | + <a href="https://dig.pm/">https://dig.pm/</a> |
| 129 | + and click Get Sub Domain. |
| 130 | + </li> |
| 131 | + <li>Input the subdomain from Step 1.</li> |
| 132 | + <li>Click all 3 of the buttons.</li> |
| 133 | + <li>Click Get Results on https://dig.pm/.</li> |
| 134 | + <li>Observe the DNS lookup record.</li> |
| 135 | + </ol> |
| 136 | + <p> |
| 137 | + Also see |
| 138 | + <a |
| 139 | + href="https://public.opentech.fund/documents/XDC-01-report_2_1.pdf" |
| 140 | + >the audit</a |
| 141 | + > |
| 142 | + and |
| 143 | + <a href="https://delta.chat/en/2023-05-22-webxdc-security" |
| 144 | + >the blog post</a |
| 145 | + >. |
| 146 | + </p> |
| 147 | + </section> |
| 148 | + <p> |
| 149 | + You can also utilize Wireshark, then https://dig.pm/ is not |
| 150 | + needed. |
| 151 | + </p> |
| 152 | + <input |
| 153 | + id="dns-prefetch-domain-input" |
| 154 | + type="text" |
| 155 | + placeholder="abc.example.com" |
| 156 | + required |
| 157 | + /> |
| 158 | + <br /> |
| 159 | + <button type="button" onclick="dnsPrefetchUpdateLocation()"> |
| 160 | + Update top.location |
| 161 | + </button> |
| 162 | + <br /> |
| 163 | + <button type="button" onclick="dnsPrefetchAddIframe()"> |
| 164 | + Add iframe |
| 165 | + </button> |
| 166 | + <br /> |
| 167 | + <button type="button" onclick="dnsPrefetchAddPrefetch()"> |
| 168 | + Add <link dns-prefetch> |
| 169 | + </button> |
| 170 | + <br /> |
| 171 | + <iframe id="dns-prefetch-frame"></iframe> |
| 172 | + </div> |
| 173 | + </div> |
| 174 | + <script src="js/dns-prefetch.js"></script> |
| 175 | + </div> |
| 176 | + </div> |
| 177 | + <div class="tabs" role="tablist" aria-orientation="horizontal"> |
| 178 | + <button |
| 179 | + role="tab" |
| 180 | + aria-controls="page-webxdc" |
| 181 | + class="tab" |
| 182 | + aria-selected="true" |
| 183 | + id="tab-webxdc" |
| 184 | + > |
| 185 | + Webxdc |
| 186 | + </button> |
| 187 | + <button |
| 188 | + role="tab" |
| 189 | + aria-controls="page-web-api" |
| 190 | + aria-selected="false" |
| 191 | + class="tab" |
| 192 | + id="tab-web-api" |
| 193 | + > |
| 194 | + Web API |
| 195 | + </button> |
| 196 | + <button |
| 197 | + role="tab" |
| 198 | + aria-controls="page-sandbox" |
| 199 | + aria-selected="false" |
| 200 | + class="tab" |
| 201 | + id="tab-sandbox" |
| 202 | + > |
| 203 | + Sandboxing |
| 204 | + </button> |
| 205 | + </div> |
| 206 | + <script> |
| 207 | + var tabs = [ |
| 208 | + { |
| 209 | + page: document.getElementById("page-webxdc"), |
| 210 | + tab: document.getElementById("tab-webxdc"), |
| 211 | + }, |
| 212 | + { |
| 213 | + page: document.getElementById("page-web-api"), |
| 214 | + tab: document.getElementById("tab-web-api"), |
| 215 | + }, |
| 216 | + { |
| 217 | + page: document.getElementById("page-sandbox"), |
| 218 | + tab: document.getElementById("tab-sandbox"), |
| 219 | + }, |
| 220 | + ]; |
| 221 | + for (const { page, tab } of tabs) { |
| 222 | + tab.onclick = () => { |
| 223 | + tabs.forEach(({ page, tab }) => { |
| 224 | + page.classList.remove("active"); |
| 225 | + tab.ariaSelected = false; |
| 226 | + }); |
| 227 | + page.classList.add("active"); |
| 228 | + tab.ariaSelected = true; |
| 229 | + }; |
| 230 | + } |
| 231 | + </script> |
| 232 | + </body> |
62 | 233 | </html> |
0 commit comments