[tor-commits] [meek/webextension] Set a webRequest.onErrorOccurred error logger.

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


commit 94332d93d53a7ed4199c2b59c60c77a55873512d
Author: David Fifield <david at bamsoftware.com>
Date:   Wed Feb 20 19:40:46 2019 -0700

    Set a webRequest.onErrorOccurred error logger.
    
    This is what enabled me to find the proxyDNS problem fixed by the
    previous commit. Without it, there was no error message in the browser
    console.
---
 webextension/background.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/webextension/background.js b/webextension/background.js
index 7ad06fe..d5bbac7 100644
--- a/webextension/background.js
+++ b/webextension/background.js
@@ -277,6 +277,12 @@ browser.webRequest.onBeforeRequest.addListener(
     ["blocking"]
 );
 
+// Set a top-level error logger for webRequest, to aid debugging.
+browser.webRequest.onErrorOccurred.addListener(
+    details => console.log(`${browser.runtime.id}: webRequest error:`, details),
+    {urls: ["http://*/*", "https://*/*"]}
+);
+
 // 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





More information about the tor-commits mailing list