`about:preferences#connection`: closing dialogs by pressing "cancel" causes settings changes
Summary
See title
Steps to reproduce:
- Go to
about:preferences#connection
- Add a bridge manually, the bridges toggle will become checked.
- Click "Select built-in bridge", then in the dialog click "cancel"
What is the current bug behavior?
The "Your Current Bridges" toggle will become unchecked.
What is the expected behavior?
Dialog closes and nothing else happens
This is not the only bad behavior related to this.
Here's the responsible code:
- https://gitlab.torproject.org/tpo/applications/tor-browser/-/blob/b2ffba38205d148463a9471e866e5e9dc8d37673/browser/components/torpreferences/content/connectionPane.js#L1061-1074
- https://gitlab.torproject.org/tpo/applications/tor-browser/-/blob/b2ffba38205d148463a9471e866e5e9dc8d37673/browser/components/torpreferences/content/provideBridgeDialog.jsm#L63-65
I'm thinking of passing the callbacks to the dialog constructors and hooking them up with this._dialog.addEventListener("dialogaccept"
instead of utilizing closingCallback
.
An alternative is to put the callback code inside the dialog's script file.
If you agree with my approach, I'd like to implement it.