commit b950f1dd8b754457a17ecfdaae8a8683f7d3602f
Author: David Fifield <[email protected]>
Date: Sat Mar 30 02:02:09 2019 -0600
Minor Chrome compatibility.
This doesn't hurt, but we're still reliant on Firefox for using the
global "browser" object (instead of "chrome"), and especially for the
proxy code, which has a totally different API in Chrome.
---
webextension/browser/background.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/webextension/browser/background.js
b/webextension/browser/background.js
index c47d06b..0b896e9 100644
--- a/webextension/browser/background.js
+++ b/webextension/browser/background.js
@@ -336,7 +336,8 @@ port.onDisconnect.addListener(p => {
//
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port#Type
// "Note that in Google Chrome port.error is not supported: instead, use
// runtime.lastError to get the error message."
- if (p.error) {
- console.log(`${browser.runtime.id}: disconnected because of error:
${p.error.message}`);
+ let error = p.error || browser.runtime.lastError;
+ if (error) {
+ console.log(`${browser.runtime.id}: disconnected because of error:
${error.message}`);
}
});
_______________________________________________
tor-commits mailing list
[email protected]
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits