... |
... |
@@ -543,11 +543,12 @@ class TorDomainIsolatorImpl { |
543
|
543
|
return;
|
544
|
544
|
}
|
545
|
545
|
|
|
546
|
+ const circuit = this.#knownCircuits.get(id);
|
546
|
547
|
logger.debug(
|
547
|
|
- `Found new credentials ${username} ${password} for browser`,
|
548
|
|
- browser
|
|
548
|
+ `Found new credentials ${username} ${password} for browser ${browser.browserId}.`,
|
|
549
|
+ browser,
|
|
550
|
+ circuit
|
549
|
551
|
);
|
550
|
|
- const circuit = this.#knownCircuits.get(id);
|
551
|
552
|
if (circuit?.length) {
|
552
|
553
|
circuitIds.current = id;
|
553
|
554
|
if (circuitIds.pending === id) {
|
... |
... |
@@ -634,15 +635,23 @@ class TorDomainIsolatorImpl { |
634
|
635
|
*/
|
635
|
636
|
#clearKnownCircuits() {
|
636
|
637
|
logger.info("Running the circuit cleanup");
|
637
|
|
- const windows = [];
|
638
|
|
- const enumerator = Services.wm.getEnumerator("navigator:browser");
|
639
|
|
- while (enumerator.hasMoreElements()) {
|
640
|
|
- windows.push(enumerator.getNext());
|
641
|
|
- }
|
642
|
|
- const browsers = windows
|
643
|
|
- .flatMap(win => win.gBrowser.browsers.map(b => b.browserId))
|
644
|
|
- .filter(id => this.#browsers.has(id));
|
645
|
|
- this.#browsers = new Map(browsers.map(id => [id, this.#browsers.get(id)]));
|
|
638
|
+ const getWindows = type => {
|
|
639
|
+ const windows = [];
|
|
640
|
+ const enumerator = Services.wm.getEnumerator(type);
|
|
641
|
+ while (enumerator.hasMoreElements()) {
|
|
642
|
+ windows.push(enumerator.getNext());
|
|
643
|
+ }
|
|
644
|
+ return windows;
|
|
645
|
+ };
|
|
646
|
+ const browserIds = [
|
|
647
|
+ ...getWindows("navigator:browser").flatMap(win =>
|
|
648
|
+ win.gBrowser.browsers.map(b => b.browserId)
|
|
649
|
+ ),
|
|
650
|
+ ...getWindows("navigator:geckoview").map(gv => gv.browser.browserId),
|
|
651
|
+ ].filter(id => this.#browsers.has(id));
|
|
652
|
+ this.#browsers = new Map(
|
|
653
|
+ browserIds.map(id => [id, this.#browsers.get(id)])
|
|
654
|
+ );
|
646
|
655
|
this.#knownCircuits = new Map(
|
647
|
656
|
Array.from(this.#browsers.values(), circuits =>
|
648
|
657
|
Array.from(circuits.values(), ids => {
|