Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Publication prefetch: run.js finds the protected-page guard where it is assigned

Barack Sokullua6dd7b4a9f10
diff --git a/test/run.js b/test/run.js
index 37c1843d6..22c5c0b98 100644
--- a/test/run.js
+++ b/test/run.js
@@ -112715,7 +112715,9 @@ test('Chrome Web Store release uses an always-on protected-page guard and opt-in
assert.match(getActiveAdapterFx(dashboard)?.notes || '', /Continue manually in the dashboard/);
const chromeAgentSource = fs.readFileSync(path.join(ROOT, 'src/chrome/src/agent/agent.js'), 'utf8');
- const guardIndex = chromeAgentSource.indexOf('const protectedPageFailure = await this._chromeProtectedPageFailure(tabId, fnName);');
+ // Declared before the call's timer starts (its stages may report a stop
+ // first); assigned here, ahead of every preparation and dispatch below.
+ const guardIndex = chromeAgentSource.indexOf('protectedPageFailure = await this._chromeProtectedPageFailure(tabId, fnName);');
const webMcpPreparationIndex = chromeAgentSource.indexOf('const webMcpPreparation = protectedPageFailure', guardIndex);
const toolbarPreflightIndex = chromeAgentSource.indexOf('const pipelineToolbarPreflight = await this._preflightRichTextToolbarTarget(', webMcpPreparationIndex);
const chatPreflightIndex = chromeAgentSource.indexOf('const genericChatBlock = pipelineToolbarPreflight.block || socialDispatchBlock ? null', toolbarPreflightIndex);