[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [meek/master] Use JavaScript compatible with Firefox 60.



commit 7e88a21ef8db19b55c3cdb3e34591c8fa1440fff
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Wed Feb 20 18:18:17 2019 -0700

    Use JavaScript compatible with Firefox 60.
    
    Object.fromEntries is not available until 63:
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries#Browser_compatibility
---
 webextension/background.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/webextension/background.js b/webextension/background.js
index b43e614..00500a0 100644
--- a/webextension/background.js
+++ b/webextension/background.js
@@ -182,7 +182,10 @@ async function roundtrip(request) {
             let headers = Object.entries(request.header != null ? request.header : {})
                 .map(x => ({name: x[0], value: x[1]}));
             // Remove all browser headers that conflict with requested headers.
-            let overrides = Object.fromEntries(headers.map(x => [x.name.toLowerCase(), true]));
+            let overrides = {};
+            for (let name of Object.keys(headers)) {
+                overrides[name.toLowerCase()] = true;
+            }
             // Also remove some unnecessary or potentially tracking-enabling headers.
             for (let name of ["Accept", "Accept-Language", "Cookie", "Origin", "User-Agent"]) {
                 overrides[name.toLowerCase()] = true;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits