Skip to content
GitLab
  • Explore
  • Sign in
  • The Tor Project
  • Applications
  • Tor BrowserTor Browser
  • Issues
  • #41958

Console error when closing tor browser with about:preferences open

Steps to reproduce.

I came across this when testing !709 (merged) but I don't think this is caused by that patch.

  1. Open tor browser.
  2. Open "about:preferences".
  3. Close tor browser (without switching tabs).

Result

See in the console:

console.error: TorProtocolService: 
  Cannot get a connection to the control port
  Message: [Exception... "Component returned failure code: 0x804b000d (NS_ERROR_CONNECTION_REFUSED) [nsIScriptableInputStream.available]"  nsresult: "0x804b000d (NS_ERROR_CONNECTION_REFUSED)"  location: "JS frame :: resource://gre/modules/TorControlPort.sys.mjs :: onInputStreamReady :: line 204"  data: no]
  Stack:
    onInputStreamReady@resource://gre/modules/TorControlPort.sys.mjs:204:46
observe@resource://gre/modules/AsyncShutdown.sys.mjs:575:17

JavaScript error: resource://gre/modules/TorProtocolService.sys.mjs, line 349: Error: SAVECONF sent an empty response

Expect

No error.

Origin

connectionPane.js calls TorProtocolService.flushSettings() on the "blur" of "about:preferences". In the steps to reproduce, the "blur" event is fired after the sockets are closed.

I'm questioning whether flushing on "blur" is the best idea anyway since blur would also be called when switching application windows or navigating the focus into the chrome.

CC @pierov seems like you might be interested in this.

Assignee
Assign to
Time tracking