ma1 pushed to branch tor-browser-115.2.0esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits: d66f99f2 by cypherpunks1 at 2023-09-08T10:16:52+00:00 Bug 41881: Don't persist custom network requests on private windows
- - - - -
1 changed file:
- devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js
Changes:
===================================== devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js ===================================== @@ -4,6 +4,11 @@
"use strict";
+const lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", +}); + const { Component, createFactory, @@ -122,10 +127,12 @@ class HTTPCustomRequestPanel extends Component {
async componentDidMount() { let { connector, request } = this.props; - const persistedCustomRequest = await asyncStorage.getItem( - "devtools.netmonitor.customRequest" - ); - request = request || persistedCustomRequest; + if (!lazy.PrivateBrowsingUtils.isWindowPrivate(window)) { + const persistedCustomRequest = await asyncStorage.getItem( + "devtools.netmonitor.customRequest" + ); + request = request || persistedCustomRequest; + }
if (!request) { this.setState({ _isStateDataReady: true }); @@ -191,7 +198,9 @@ class HTTPCustomRequestPanel extends Component { }
componentWillUnmount() { - asyncStorage.setItem("devtools.netmonitor.customRequest", this.state); + if (!lazy.PrivateBrowsingUtils.isWindowPrivate(window)) { + asyncStorage.setItem("devtools.netmonitor.customRequest", this.state); + } }
handleChangeURL(event) {
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/d66f99f2...