[tor-commits] [flashproxy/master] Test window.navigator.userAgent for truth instead of against null.

dcf at torproject.org dcf at torproject.org
Sun Nov 10 08:12:36 UTC 2013


commit 2bc332dc074f17c3794a79a1ceaa0bb0b0d0533a
Author: David Fifield <david at bamsoftware.com>
Date:   Sat Nov 9 23:35:38 2013 -0800

    Test window.navigator.userAgent for truth instead of against null.
    
    We're about to add a patch where it can be undefined rather than null.
    See https://trac.torproject.org/projects/tor/ticket/9069#comment:8.
---
 proxy/flashproxy.js |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxy/flashproxy.js b/proxy/flashproxy.js
index b739464..8f73aba 100644
--- a/proxy/flashproxy.js
+++ b/proxy/flashproxy.js
@@ -429,7 +429,7 @@ function have_websocket_binary_frames() {
     var ua, matches;
 
     ua = window.navigator.userAgent;
-    if (ua === null)
+    if (!ua)
         return false;
 
     /* We are cool for Chrome 16 or Safari 6.0. */
@@ -1050,7 +1050,7 @@ function flashproxy_should_disable() {
     }
 
     ua = window.navigator.userAgent;
-    if (ua !== null) {
+    if (ua) {
         var UA_LIST = [
             /\bmobile\b/i,
             /\bandroid\b/i,





More information about the tor-commits mailing list