diff --git a/browser-extension/mv3/test/network-recording-test.html b/browser-extension/mv3/test/network-recording-test.html
index 67b9d0743c..61886e8d5a 100644
--- a/browser-extension/mv3/test/network-recording-test.html
+++ b/browser-extension/mv3/test/network-recording-test.html
@@ -57,10 +57,18 @@
2. Start Recording
Disable browser cache (wipe HTTP cache at start)
Wipe service workers (+ Cache API) at start
Record Ajax (XHR/fetch) request & response bodies
-
+
All requests
Top-level only
+ Open recording in
+
+ New tab
+ New window
+ New incognito window
+
+ Incognito requires "Allow in Incognito" enabled for the extension at chrome://extensions — otherwise start is rejected (INCOGNITO_NOT_ALLOWED), never silently downgraded to a normal window.
+ Close recording surface on stop (tab in tab mode; window in window/incognito mode)
Status: Idle
@@ -125,8 +133,10 @@ Log
const wipeServiceWorkers = document.getElementById('wipeServiceWorkers').checked;
const recordAjax = document.getElementById('recordAjax').checked;
const requestScope = document.querySelector('input[name="requestScope"]:checked')?.value || 'all';
+ const openMode = document.querySelector('input[name="openMode"]:checked')?.value || 'tab';
+ const closeOnStop = document.getElementById('closeOnStop').checked;
- log(`Sending startNetworkRecording for: ${url}`);
+ log(`Sending startNetworkRecording for: ${url} (openMode=${openMode}, closeOnStop=${closeOnStop})`);
chrome.runtime.sendMessage(
extId,
@@ -134,7 +144,7 @@ Log
action: "startNetworkRecording",
payload: {
url: url,
- config: { maxDuration: 15 * 60 * 1000, disableCache, wipeServiceWorkers, recordAjax, requestScope },
+ config: { maxDuration: 15 * 60 * 1000, disableCache, wipeServiceWorkers, recordAjax, requestScope, openMode, closeOnStop },
},
},
(response) => {
@@ -144,6 +154,7 @@ Log
}
log(`Response: ${JSON.stringify(response)}`, 'data');
+ console.log('[network-recording] startNetworkRecording response:', response);
if (response?.success) {
currentTargetTabId = response.targetTabId;
@@ -152,10 +163,18 @@ Log
document.getElementById('status').className = 'status status-recording';
document.getElementById('btnStart').disabled = true;
document.getElementById('btnStop').disabled = false;
- log(`Recording started on tab ${currentTargetTabId}`, 'info');
+ // Echo the resolved open mode (openedMode) the extension actually opened — confirms
+ // window/incognito rather than just what we asked for.
+ log(`Recording started on tab ${currentTargetTabId} (opened in: ${response.openedMode || 'tab'})`, 'info');
openStream(extId, currentTargetTabId);
} else {
- log('Failed to start recording', 'error');
+ // Surface the typed rejection code (INCOGNITO_NOT_ALLOWED / INCOGNITO_DISABLED_BY_POLICY)
+ // distinctly from the generic error, so the incognito-gating path is obvious while testing.
+ if (response?.code) {
+ log(`Failed to start recording [${response.code}]: ${response.error || ''}`, 'error');
+ } else {
+ log(`Failed to start recording: ${response?.error || 'unknown error'}`, 'error');
+ }
}
}
);