ma1 pushed to branch base-browser-115.2.0esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits: 95b3625a by cypherpunks1 at 2023-09-08T11:45:15+01: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/95b3625a...
tor-commits@lists.torproject.org