Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
35a864ab by Pier Angelo Vendrame at 2024-05-14T13:32:40+02:00
Comment differences between locales and locales_mobile.
See tor-browser-build!967.
- - - - -
1 changed file:
- rbm.conf
Changes:
=====================================
rbm.conf
=====================================
@@ -162,9 +162,11 @@ var:
- fr
- ga-rIE
- hu
+ # Indonesian (id in var/locales)
- in
- is
- it
+ # Modern Hebrew (he in var/locales)
- iw
- ja
- ka
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/3…
--
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/3…
You're receiving this email because of your account on gitlab.torproject.org.
Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android
Commits:
e2bd6fda by clairehurst at 2024-05-14T00:00:14+00:00
fixup! Implement Android-native Connection Assist UI
- - - - -
2 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistFragment.kt
- fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistViewModel.kt
Changes:
=====================================
fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistFragment.kt
=====================================
@@ -62,6 +62,7 @@ class TorConnectionAssistFragment : Fragment(), UserInteractionHandler {
override fun onResume() {
super.onResume()
hideToolbar()
+ viewModel.handleTorConnectStateToScreen() // Covers the case where the app is backgrounded when the bootstrap finishes
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@@ -86,6 +87,7 @@ class TorConnectionAssistFragment : Fragment(), UserInteractionHandler {
viewModel.shouldOpenHome().observe(
viewLifecycleOwner,
) {
+ Log.d(TAG, "shouldOpenHome() = $it")
if (it) {
openHome()
}
=====================================
fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistViewModel.kt
=====================================
@@ -46,6 +46,7 @@ class TorConnectionAssistViewModel(
init {
Log.d(TAG, "initiating TorConnectionAssistViewModel")
_torController.registerTorListener(this)
+ handleTorConnectStateToScreen() // should cover the case of when we have an onBootStrapStateChange() event before this is initialized, which lead to being stuck on the splash screen
}
private fun handleConnect(
@@ -95,6 +96,10 @@ class TorConnectionAssistViewModel(
_progress.value = progress.toInt()
}
+ handleTorConnectStateToScreen()
+ }
+
+ fun handleTorConnectStateToScreen() {
when (_torController.lastKnownStatus) {
TorConnectState.Initial -> _torConnectScreen.value = ConnectAssistUiState.Splash
TorConnectState.Configuring -> handleConfiguring()
@@ -144,7 +149,11 @@ class TorConnectionAssistViewModel(
/** stay here */
}
- else -> _torConnectScreen.value = ConnectAssistUiState.Connecting
+ else -> _torConnectScreen.value =
+ ConnectAssistUiState.Connecting.also { connectAssistUiState ->
+ // covers the case of when the bootstrap is already in progress when the UiState "catches up"
+ connectAssistUiState.progress = _progress.value ?: 0
+ }
}
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/e2b…
--
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/e2b…
You're receiving this email because of your account on gitlab.torproject.org.
richard pushed to branch mullvad-browser-115.11.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser
Commits:
bea39ca4 by Pier Angelo Vendrame at 2024-05-13T20:40:44+00:00
Revert "Bug 41881: Don't persist custom network requests on private windows"
This reverts commit 6450a4e62e810832f35ee8732a4630ec2c2ba6f6.
- - - - -
400cba03 by cypherpunks1 at 2024-05-13T20:40:45+00:00
Bug 1892052 - Do not persist custom network requests on PBM. r=devtools-reviewers,bomsy,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D207762
- - - - -
3 changed files:
- devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js
- devtools/client/netmonitor/test/browser_net_new_request_panel_persisted_content.js
- devtools/client/netmonitor/test/head.js
Changes:
=====================================
devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js
=====================================
@@ -4,11 +4,6 @@
"use strict";
-const lazy = {};
-ChromeUtils.defineESModuleGetters(lazy, {
- PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
-});
-
const {
Component,
createFactory,
@@ -127,7 +122,7 @@ class HTTPCustomRequestPanel extends Component {
async componentDidMount() {
let { connector, request } = this.props;
- if (!lazy.PrivateBrowsingUtils.isWindowPrivate(window)) {
+ if (!connector.currentTarget?.targetForm?.isPrivate) {
const persistedCustomRequest = await asyncStorage.getItem(
"devtools.netmonitor.customRequest"
);
@@ -198,7 +193,7 @@ class HTTPCustomRequestPanel extends Component {
}
componentWillUnmount() {
- if (!lazy.PrivateBrowsingUtils.isWindowPrivate(window)) {
+ if (!this.props.connector.currentTarget?.targetForm?.isPrivate) {
asyncStorage.setItem("devtools.netmonitor.customRequest", this.state);
}
}
=====================================
devtools/client/netmonitor/test/browser_net_new_request_panel_persisted_content.js
=====================================
@@ -9,30 +9,14 @@ const asyncStorage = require("resource://devtools/shared/async-storage.js");
* Test if content is still persisted after the panel is closed
*/
-add_task(async function () {
- // Turn true the pref
- await pushPref("devtools.netmonitor.features.newEditAndResend", true);
- // Reset the storage for the persisted custom request
- await asyncStorage.removeItem("devtools.netmonitor.customRequest");
-
- const { monitor } = await initNetMonitor(HTTPS_CUSTOM_GET_URL, {
- requestCount: 1,
- });
- info("Starting test... ");
-
- const { document, store, windowRequire } = monitor.panelWin;
-
- // Action should be processed synchronously in tests.
- const Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
- store.dispatch(Actions.batchEnable(false));
-
- info("open the left panel");
- let waitForPanels = waitForDOM(
+async function addCustomRequestTestContent(tab, monitor, document) {
+ info("Open the left panel");
+ const waitForPanels = waitForDOM(
document,
".monitor-panel .network-action-bar"
);
- let HTTPCustomRequestButton = document.querySelector(
+ const HTTPCustomRequestButton = document.querySelector(
"#netmonitor-toolbar-container .devtools-http-custom-request-icon"
);
HTTPCustomRequestButton.click();
@@ -59,91 +43,166 @@ add_task(async function () {
"#http-custom-query .map-add-new-inputs .http-custom-input-name"
);
newParameterName.focus();
- EventUtils.sendString("My-param");
+ EventUtils.sendString("My-param", monitor.panelWin);
info("Adding new headers");
const newHeaderName = document.querySelector(
"#http-custom-headers .map-add-new-inputs .http-custom-input-name"
);
newHeaderName.focus();
- EventUtils.sendString("My-header");
+ EventUtils.sendString("My-header", monitor.panelWin);
const newHeaderValue = Array.from(
document.querySelectorAll(
"#http-custom-headers .http-custom-input .http-custom-input-value"
)
- ).pop();
+ ).at(-1);
newHeaderValue.focus();
- EventUtils.sendString("my-value");
+ EventUtils.sendString("my-value", monitor.panelWin);
const postValue = document.querySelector("#http-custom-postdata-value");
postValue.focus();
- EventUtils.sendString("{'Name': 'Value'}");
+ EventUtils.sendString("{'Name': 'Value'}", monitor.panelWin);
- // Close the panel
+ info("Close the panel");
const closePanel = document.querySelector(
".network-action-bar .tabs-navigation .sidebar-toggle"
);
closePanel.click();
+}
- // Open the panel again to see if the content is still there
- waitForPanels = waitUntil(
+async function runTests(tab, monitor, document, isPrivate = false) {
+ info("Open the panel again to see if the content is still there");
+ const waitForPanels = waitFor(
() =>
document.querySelector(".http-custom-request-panel") &&
document.querySelector("#http-custom-request-send-button").disabled ===
- false
+ isPrivate
);
- HTTPCustomRequestButton = document.querySelector(
+ const HTTPCustomRequestButton = document.querySelector(
"#netmonitor-toolbar-container .devtools-http-custom-request-icon"
);
HTTPCustomRequestButton.click();
await waitForPanels;
- is(
- methodValue.value,
- "POST",
- "The content should still be there after the user close the panel and re-opened"
- );
-
- is(
- url.value,
- "https://www.example.com?My-param=",
- "The url should still be there after the user close the panel and re-opened"
- );
+ // Wait a few seconds to make sure all the fields have been updated
+ await wait(1500);
+
+ const customMethod = document.querySelector("#http-custom-method-value");
+ const customUrl = document.querySelector(".http-custom-url-value");
+ const customQuery = document.querySelectorAll(
+ "#http-custom-query .tabpanel-summary-container.http-custom-input textarea"
+ );
+ const customHeaders = document.querySelectorAll(
+ "#http-custom-headers .tabpanel-summary-container.http-custom-input textarea"
+ );
+ const postDataValue = document.querySelector("#http-custom-postdata-value");
+
+ if (isPrivate) {
+ is(
+ customMethod.value,
+ "GET",
+ "The method should not be persisted after the user close the panel and re-opened in PBM"
+ );
+
+ is(
+ customUrl.value,
+ "",
+ "The url should not be there after the user close the panel and re-opened in PBM"
+ );
+
+ is(
+ customQuery.length,
+ 0,
+ "The Parameter should not be there after the user close the panel and re-opened in PBM"
+ );
+
+ is(
+ customHeaders.length,
+ 0,
+ "There should be no custom headers after the user close the panel and re-opened in PBM"
+ );
+
+ is(
+ postDataValue.value,
+ "",
+ "The post data should still be reset after the user close the panel and re-opened in PBM"
+ );
+ } else {
+ is(
+ customMethod.value,
+ "POST",
+ "The method should be persisted after the user close the panel and re-opened"
+ );
+
+ is(
+ customUrl.value,
+ "https://www.example.com?My-param=",
+ "The url should still be there after the user close the panel and re-opened"
+ );
+
+ const [nameParam] = Array.from(customQuery);
+ is(
+ nameParam.value,
+ "My-param",
+ "The Parameter name should still be there after the user close the panel and re-opened"
+ );
+
+ const [name, value] = Array.from(customHeaders);
+ is(
+ name.value,
+ "My-header",
+ "The header name should still be there after the user close the panel and re-opened"
+ );
+ is(
+ value.value,
+ "my-value",
+ "The header value should still be there after the user close the panel and re-opened"
+ );
+
+ is(
+ postDataValue.value,
+ "{'Name': 'Value'}",
+ "The content should still be there after the user close the panel and re-opened"
+ );
+ }
+}
+
+add_task(async function testRequestPanelPersistedContent() {
+ // Turn true the pref
+ await pushPref("devtools.netmonitor.features.newEditAndResend", true);
+ // Reset the storage for the persisted custom request
+ await asyncStorage.removeItem("devtools.netmonitor.customRequest");
- const [nameParam] = Array.from(
- document.querySelectorAll(
- "#http-custom-query .tabpanel-summary-container.http-custom-input textarea"
- )
- );
- is(
- nameParam.value,
- "My-param",
- "The Parameter name should still be there after the user close the panel and re-opened"
- );
+ const { tab, monitor } = await initNetMonitor(HTTPS_CUSTOM_GET_URL, {
+ requestCount: 1,
+ });
+ const { document, store, windowRequire } = monitor.panelWin;
+ const Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
+ store.dispatch(Actions.batchEnable(false));
- const [name, value] = Array.from(
- document.querySelectorAll(
- "#http-custom-headers .tabpanel-summary-container.http-custom-input textarea"
- )
- );
- is(
- name.value,
- "My-header",
- "The header name should still be there after the user close the panel and re-opened"
- );
- is(
- value.value,
- "my-value",
- "The header value should still be there after the user close the panel and re-opened"
- );
+ info("Starting test... ");
+ info("Add initial custom request test content");
+ await addCustomRequestTestContent(tab, monitor, document);
+ await runTests(tab, monitor, document);
+ await teardown(monitor);
+});
- is(
- postValue.value,
- "{'Name': 'Value'}",
- "The content should still be there after the user close the panel and re-opened"
+add_task(async function testRequestPanelPersistedContentInPrivateWindow() {
+ await pushPref("devtools.netmonitor.features.newEditAndResend", true);
+ const { tab, monitor, privateWindow } = await initNetMonitor(
+ HTTPS_CUSTOM_GET_URL,
+ {
+ requestCount: 1,
+ openInPrivateWindow: true,
+ }
);
+ const { document, store, windowRequire } = monitor.panelWin;
+ const Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
+ store.dispatch(Actions.batchEnable(false));
- await teardown(monitor);
+ info("Starting test in private window... ");
+ await runTests(tab, monitor, document, true);
+ await teardown(monitor, privateWindow);
});
=====================================
devtools/client/netmonitor/test/head.js
=====================================
@@ -321,6 +321,7 @@ function initNetMonitor(
expectedEventTimings,
waitForLoad = true,
enableCache = false,
+ openInPrivateWindow = false,
}
) {
info("Initializing a network monitor pane.");
@@ -341,7 +342,22 @@ function initNetMonitor(
],
});
- const tab = await addTab(url, { waitForLoad });
+ let tab = null;
+ let privateWindow = null;
+
+ if (openInPrivateWindow) {
+ privateWindow = await BrowserTestUtils.openNewBrowserWindow({
+ private: true,
+ });
+ ok(
+ PrivateBrowsingUtils.isContentWindowPrivate(privateWindow),
+ "window is private"
+ );
+ tab = BrowserTestUtils.addTab(privateWindow.gBrowser, url);
+ } else {
+ tab = await addTab(url, { waitForLoad });
+ }
+
info("Net tab added successfully: " + url);
const toolbox = await gDevTools.showToolboxForTab(tab, {
@@ -371,7 +387,7 @@ function initNetMonitor(
await clearNetworkEvents(monitor);
}
- return { tab, monitor, toolbox };
+ return { tab, monitor, toolbox, privateWindow };
})();
}
@@ -408,7 +424,7 @@ async function clearNetworkEvents(monitor) {
store.dispatch(Actions.clearRequests());
}
-function teardown(monitor) {
+function teardown(monitor, privateWindow) {
info("Destroying the specified network monitor.");
return (async function () {
@@ -419,6 +435,12 @@ function teardown(monitor) {
await monitor.toolbox.destroy();
await removeTab(tab);
+
+ if (privateWindow) {
+ const closed = BrowserTestUtils.windowClosed(privateWindow);
+ privateWindow.BrowserCommands.tryToCloseWindow();
+ await closed;
+ }
})();
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/be…
--
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/be…
You're receiving this email because of your account on gitlab.torproject.org.