Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
fix(captcha): persist bridge registration across restarts
16Miku1f56ad456dc4
diff --git a/src/chrome/src/agent/captcha-bridge-registration.js b/src/chrome/src/agent/captcha-bridge-registration.jsindex 6a9c9456f..0a82fda85 100644--- a/src/chrome/src/agent/captcha-bridge-registration.js+++ b/src/chrome/src/agent/captcha-bridge-registration.js@@ -42,7 +42,7 @@ export function createCaptchaBridgeRegistration(api) {world: 'MAIN',allFrames: true,matchOriginAsFallback: true,- persistAcrossSessions: false,+ persistAcrossSessions: true,}]);} else if (!enabled && registered) {await scripting.unregisterContentScripts({ ids: [SCRIPT_ID] });diff --git a/src/firefox/src/agent/captcha-bridge-registration.js b/src/firefox/src/agent/captcha-bridge-registration.jsindex 6a9c9456f..0a82fda85 100644--- a/src/firefox/src/agent/captcha-bridge-registration.js+++ b/src/firefox/src/agent/captcha-bridge-registration.js@@ -42,7 +42,7 @@ export function createCaptchaBridgeRegistration(api) {world: 'MAIN',allFrames: true,matchOriginAsFallback: true,- persistAcrossSessions: false,+ persistAcrossSessions: true,}]);} else if (!enabled && registered) {await scripting.unregisterContentScripts({ ids: [SCRIPT_ID] });diff --git a/test/captcha-bridge-registration.mjs b/test/captcha-bridge-registration.mjsindex dfb8d3214..88d9b83d7 100644--- a/test/captcha-bridge-registration.mjs+++ b/test/captcha-bridge-registration.mjs@@ -27,8 +27,10 @@ for (const build of ['chrome', 'firefox']) {world: 'MAIN',allFrames: true,matchOriginAsFallback: true,- persistAcrossSessions: false,+ persistAcrossSessions: true,});+ await createCaptchaBridgeRegistration(api).sync(true);+ assert.equal(registered.length, 1, 'a persisted registration should be reused after a background restart');await registration.sync(true);assert.equal(registered.length, 1);await registration.sync(false);