[tor-commits] [flashproxy/master] Tentatively enable binary frames for Chrome >= 16.

dcf at torproject.org dcf at torproject.org
Sun Apr 15 05:51:38 UTC 2012


commit 3a30a20143c68aa9ff82dccfd7371b03976e1bb6
Author: David Fifield <david at bamsoftware.com>
Date:   Sat Apr 14 21:48:51 2012 -0700

    Tentatively enable binary frames for Chrome >= 16.
    
    They work for me on Chromium 17.
---
 flashproxy.js |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/flashproxy.js b/flashproxy.js
index c671724..aa16e83 100644
--- a/flashproxy.js
+++ b/flashproxy.js
@@ -252,6 +252,16 @@ function format_addr(addr) {
    6455 section 5.6.) If not, we have to use base64-encoded text frames. It is
    assumed that the client and relay endpoints always support binary frames. */
 function have_websocket_binary_frames() {
+    var ua, matches;
+
+    ua = window.navigator.userAgent;
+    if (ua === null)
+        return false;
+
+    matches = ua.match(/\bchrome\/(\d+)/i);
+    if (matches !== null && Number(matches[1]) >= 16)
+        return true;
+
     return false;
 }
 





More information about the tor-commits mailing list