OLD | NEW |
(Empty) | |
| 1 <title>Test whether a WebSocket connection triggers a SafeBrowsing interstitial<
/title> |
| 2 <script> |
| 3 // Construct the WebSocket URL from the page URL. The server should not be |
| 4 // configured to accept a WebSocket handshake at this endpoint, or the "not |
| 5 // blocked" test will fail. A 404 error is perfect. |
| 6 const wsUrl = new URL('/safe_browsing/malware-ws', document.location.href); |
| 7 wsUrl.protocol = 'ws'; |
| 8 const ws = new WebSocket(wsUrl.href); |
| 9 // The "not blocked" test looks for this title change to verify that the request |
| 10 // has not been blocked. |
| 11 ws.onerror = () => { document.title = 'COMPLETED'; }; |
| 12 </script> |
OLD | NEW |