[tor-commits] [flashproxy/master] Check for latest Tor Browser user agent.

dcf at torproject.org dcf at torproject.org
Wed Mar 13 05:46:33 UTC 2013


commit dab70b79e22448524a4fa84844f8bfa9f34bdec7
Author: Alexandre Allaire <alexandre.allaire at mail.mcgill.ca>
Date:   Sat Mar 9 11:39:17 2013 -0500

    Check for latest Tor Browser user agent.
    
    The latest version of the Tor Browser has a new user agent string,
    check for it in is_likely_tor_browser().
---
 proxy/flashproxy.js |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/proxy/flashproxy.js b/proxy/flashproxy.js
index bf3fce9..d229087 100644
--- a/proxy/flashproxy.js
+++ b/proxy/flashproxy.js
@@ -930,9 +930,13 @@ function repr(x) {
 
 /* Do we seem to be running in Tor Browser? Check the user-agent string, lack of
    DOM storage, and no listing of supported MIME types. */
-var TBB_UA = "Mozilla/5.0 (Windows NT 6.1; rv:10.0) Gecko/20100101 Firefox/10.0";
+var TBB_UA = [
+    "Mozilla/5.0 (Windows NT 6.1; rv:10.0) Gecko/20100101 Firefox/10.0",
+    "Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0"
+];
+
 function is_likely_tor_browser() {
-    return window.navigator.userAgent === TBB_UA
+    return TBB_UA.indexOf(window.navigator.userAgent) > 0
         && window.sessionStorage === null
         && (window.navigator.mimeTypes && window.navigator.mimeTypes.length === 0);
 }





More information about the tor-commits mailing list