[tor-commits] [meek/webextension] Set network.proxy.socks_remote_dns=false inside the WebExtension.

dcf at torproject.org dcf at torproject.org
Sat Feb 23 01:45:42 UTC 2019

commit e0c466d67711eaf1b264791d93f53360432b9cbd
Author: David Fifield <david at bamsoftware.com>
Date:   Wed Feb 20 19:26:48 2019 -0700

    Set network.proxy.socks_remote_dns=false inside the WebExtension.
    This is to work around a Firefox patch that otherwise prevents DNS
    requests from being made when proxyType=="direct".
    Compare to
 webextension/background.js | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/webextension/background.js b/webextension/background.js
index 00500a0..7ad06fe 100644
--- a/webextension/background.js
+++ b/webextension/background.js
@@ -277,6 +277,22 @@ browser.webRequest.onBeforeRequest.addListener(
+// Allow unproxied DNS, working around a Tor Browser patch: https://bugs.torproject.org/11183#comment:6.
+// We manually override the proxy for every request, and in makeProxyInfo we set
+// proxyDNS:true wherever necessary, so name resolution uses the proxy despite
+// this pref.
+// In Tor Browser, the pref changes here are only temporary. The
+// meek-http-helper profile has a user.js file that sets a default blackhole
+// proxy, as a safety feature in case something goes wrong running the headless
+// browser.
+// We only care to set proxyDNS here, but must additionally set proxyType until
+// Firefox 63 because of a bug.
+// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy/settings
+// https://bugzilla.mozilla.org/show_bug.cgi?id=1487121
+browser.proxy.settings.set({value: {proxyType: "system", proxyDNS: false}});
 // Connect to our native process.
 let port = browser.runtime.connectNative("meek.http.helper");

More information about the tor-commits mailing list