Skip to content

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

feat: support editing custom skills, enable strict secret mode by default, and handle native browser dialogs

Emre Sokullu41986e078c22
diff --git a/docs/architecture.md b/docs/architecture.md
index 8c0df548d..400015b72 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -814,6 +814,25 @@ Wraps `chrome.debugger` API for:
`WebMCP.invokeTool` executes a page-registered structured capability. WebBrain
exposes opaque `wmcp_*` IDs rather than page-controlled names as call handles.
+During active Chrome Act/Dev runs (including saved workflow replay), native
+JavaScript dialogs are continued through `Page.javascriptDialogOpening` and
+`Page.handleJavaScriptDialog`. Alerts and confirmations are accepted;
+`beforeunload` warnings choose Leave; prompts use the site's default text (or
+an empty string when no default exists). This includes accepting confirmation
+of the pending page action and potentially discarding unsaved changes. Dialog
+text is never interpreted as instructions. The event handler runs independently
+of blocked renderer commands, and is removed on Stop, completion, or detach,
+even when Dev diagnostics keep the debugger attached. Ask mode and idle tabs
+do not auto-answer dialogs. Already-observed dialogs are resolved before
+startup commands, so retained Dev connections can resume them. Chrome does not
+expose a dialog opened before debugger attachment to the new session; dismiss
+that existing dialog manually. Dialog setup responds to Stop and times out after
+five seconds rather than holding the run indefinitely. Existing action permission
+checks still apply.
+This does not handle browser permission requests, authentication windows, or
+OS file pickers. Firefox WebExtensions provide no equivalent native-dialog API;
+those dialogs still require manual handling in Firefox.
+
WebMCP is an experimental Chrome-only fast path that is off by default. The
user must enable **Experimental WebMCP** under Settings → General → Advanced;
until then, neither WebMCP tool schemas nor WebMCP prompt guidance enter model
diff --git a/package.json b/package.json
index c1c025865..7139af282 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,7 @@
"private": true,
"type": "module",
"scripts": {
- "test": "npm run test:runtime-lifecycle && npm run test:provider-limits && npm run test:toolbar-guard && npm run test:pdf-read && npm run test:pdf-selection && npm run test:social-contract && node test/run.js && node test/selection-scope-restoration.mjs && node scripts/benchmark-offline-relevance.mjs && npm run test:security",
+ "test": "node --test test/browser-dialogs.mjs && npm run test:runtime-lifecycle && npm run test:provider-limits && npm run test:toolbar-guard && npm run test:pdf-read && npm run test:pdf-selection && npm run test:social-contract && node test/run.js && node test/selection-scope-restoration.mjs && node scripts/benchmark-offline-relevance.mjs && npm run test:security",
"test:provider-limits": "node test/provider-model-limits.mjs",
"test:security": "node test/security/injection-corpus.mjs",
"test:toolbar-guard": "node test/rich-text-toolbar-guard.mjs",
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.js
index 55ae57f3d..159e11f3e 100644
--- a/src/chrome/src/agent/agent.js
+++ b/src/chrome/src/agent/agent.js
@@ -1009,12 +1009,10 @@ export class Agent extends LoopDetector {
// Strict secret-handling mode. When true, the system prompt and `done`
// tool description add a hard prohibition on quoting credentials, while
// the post-set_field credential note tells the model to never echo the
- // value. When false (the default — this is a personal-computer tool,
- // not a third-party deployment), the model avoids needless echoes but can
- // deliver a credential it generated for this task or quote one when the
- // user explicitly asks ("show me my recovery codes", "what's my API key
- // on this page"). Toggle
- // lives in Settings → "Strict secret handling". Loaded in background.js.
+ // value. When false, the model avoids needless echoes but can deliver a
+ // credential it generated for this task or quote one when the user explicitly
+ // asks ("show me my recovery codes", "what's my API key on this page").
+ // Defaults to true at extension runtime via background.js and Settings.
this.strictSecretMode = false;
// Experimental Chrome WebMCP integration. Off by default so ordinary
@@ -5979,6 +5977,7 @@ export class Agent extends LoopDetector {
}
_releaseRunEntry(tabId) {
+ cdpClient.stopDialogHandling(tabId);
this._runAbortStates.get(tabId)?.dispose();
this._runAbortStates.delete(tabId);
this.abortFlags.delete(tabId);
@@ -16004,6 +16003,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
abort(tabId) {
for (const id of this._researchEscalationTabIds(tabId)) {
this.abortFlags.set(id, true);
+ cdpClient.stopDialogHandling(id);
const controller = this._runAbortStates.get(id)?.controller;
if (controller && !controller.signal.aborted) {
const error = new Error('Stopped by user');
@@ -32042,6 +32042,11 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
this._prepareClarificationAuthorizationForRun(tabId);
this.permissions.beginTurn(tabId);
this.conversationModes.set(tabId, 'act');
+ await cdpClient.startDialogHandling(tabId, { signal: this._runAbortSignal(tabId) })
+ .catch(error => {
+ if (error?.name === 'AbortError' || error?.code === 'dialog_startup_timeout') throw error;
+ // Restricted tabs can still use non-CDP tools.
+ });
completionRunToken = this._beginCompletionInvariant(tabId);
previousForegroundCapture = this._configureCapturePolicyForRun(tabId, runOptions);
capturePolicyConfigured = true;
@@ -32076,7 +32081,10 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
try {
if (completionRunToken) this._clearCompletionInvariant(tabId, completionRunToken);
} finally {
- this._releaseRunEntry(tabId);
+ try {
+ await cdpClient.cleanupRun(tabId);
+ } catch { /* preserve the original setup failure */ }
+ finally { this._releaseRunEntry(tabId); }
}
}
throw error;
@@ -40225,10 +40233,19 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
this.cloudRunContexts.set(tabId, { outputSchema: runOptions.outputSchema ?? null, schemaRepairUsed: false });
}
try {
+ if ((mode === 'act' || mode === 'dev') && !this._isStandaloneChatRun(runOptions)) {
+ await cdpClient.startDialogHandling(tabId, {
+ signal: this._runAbortSignal(tabId),
+ }).catch(error => {
+ if (error?.name === 'AbortError' || error?.code === 'dialog_startup_timeout') throw error;
+ // Restricted tabs can still use non-CDP tools.
+ });
+ }
const result = await this._processMessageInner(tabId, userMessage, onUpdate, mode, attachments, runOptions);
void this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
return result;
} finally {
+ cdpClient.stopDialogHandling(tabId);
this.currentCostState.delete(tabId);
this._discardProvisionalSelectionGroundingScope(tabId);
this._storeContinuationExecutionEvidence(tabId);
@@ -41827,10 +41844,19 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
this.cloudRunContexts.set(tabId, { outputSchema: runOptions.outputSchema ?? null, schemaRepairUsed: false });
}
try {
+ if ((mode === 'act' || mode === 'dev') && !this._isStandaloneChatRun(runOptions)) {
+ await cdpClient.startDialogHandling(tabId, {
+ signal: this._runAbortSignal(tabId),
+ }).catch(error => {
+ if (error?.name === 'AbortError' || error?.code === 'dialog_startup_timeout') throw error;
+ // Restricted tabs can still use non-CDP tools.
+ });
+ }
const result = await this._processMessageStreamInner(tabId, userMessage, onUpdate, mode, runOptions);
void this._maybeEmitAskModeHandoff(tabId, mode, userMessage, result, onUpdate, runOptions);
return result;
} finally {
+ cdpClient.stopDialogHandling(tabId);
this.currentCostState.delete(tabId);
this._discardProvisionalSelectionGroundingScope(tabId);
this._storeContinuationExecutionEvidence(tabId);
diff --git a/src/chrome/src/background.js b/src/chrome/src/background.js
index 0ac6a43b7..551030533 100644
--- a/src/chrome/src/background.js
+++ b/src/chrome/src/background.js
@@ -567,7 +567,7 @@ const imageBudgetReady = loadImageBudget().catch(() => {});
async function loadStrictSecretMode() {
const stored = await chrome.storage.local.get('strictSecretMode');
- if (stored.strictSecretMode != null) agent.strictSecretMode = !!stored.strictSecretMode;
+ agent.strictSecretMode = stored.strictSecretMode !== false;
}
loadStrictSecretMode();
diff --git a/src/chrome/src/cdp/cdp-client.js b/src/chrome/src/cdp/cdp-client.js
index 29a99dc08..bafdd6e64 100644
--- a/src/chrome/src/cdp/cdp-client.js
+++ b/src/chrome/src/cdp/cdp-client.js
@@ -94,11 +94,22 @@ export class CDPClient {
this.devDiagnostics = new Map(); // tabId -> bounded console/network buffers
this.webMcpSessions = new Map(); // tabId -> WebMCP tools + pending invocations
this.runtimeContexts = new Map(); // tabId -> session/context key -> default context
+ this.pendingDialogs = new Map(); // tabId -> sessionId -> current native dialog
+ this.dialogRuns = new Map(); // tabId -> active action-run owner
this.fileChooserGuards = new Map(); // tabId -> temporary protocol interception
this._debuggerListenersRegistered = false;
this._onDebuggerEvent = (source, method, params) => {
const tabId = source?.tabId;
if (tabId == null) return;
+ if (method === 'Page.javascriptDialogOpening') {
+ if (!this.pendingDialogs.has(tabId)) this.pendingDialogs.set(tabId, new Map());
+ const dialog = { type: params?.type, defaultPrompt: params?.defaultPrompt };
+ this.pendingDialogs.get(tabId).set(source.sessionId || '', dialog);
+ this._continueJavaScriptDialog(tabId, source, dialog);
+ } else if (method === 'Page.javascriptDialogClosed') {
+ this.pendingDialogs.get(tabId)?.delete(source.sessionId || '');
+ if (!this.pendingDialogs.get(tabId)?.size) this.pendingDialogs.delete(tabId);
+ }
this._trackRuntimeContextEvent(tabId, source, method, params);
const handlers = this.eventHandlers.get(tabId)?.[method];
if (handlers) {
@@ -108,6 +119,8 @@ export class CDPClient {
this._onDebuggerDetach = (source, reason) => {
const tabId = source?.tabId;
if (tabId == null) return;
+ this.stopDialogHandling(tabId);
+ this.pendingDialogs.delete(tabId);
this._dropWebMCPSession(tabId, `Debugger detached: ${reason || 'unknown reason'}`);
this.sessions.delete(tabId);
this.eventHandlers.delete(tabId);
@@ -205,6 +218,8 @@ export class CDPClient {
* Detach debugger from a tab.
*/
async detach(tabId) {
+ this.stopDialogHandling(tabId);
+ this.pendingDialogs.delete(tabId);
if (!this.sessions.has(tabId)) {
const pendingAttach = this.attachPromises.get(tabId);
if (!pendingAttach) return;
@@ -238,6 +253,7 @@ export class CDPClient {
* page-owned catalog.
*/
async cleanupRun(tabId) {
+ this.stopDialogHandling(tabId);
try { await this.disableWebMCP(tabId); } catch {}
if (!this.devDiagnostics.has(tabId)) await this.detach(tabId);
}
@@ -257,6 +273,81 @@ export class CDPClient {
await this.detach(tabId);
}
+ /** Native dialogs pause renderer commands, so resolve them from the debugger
+ * event callback rather than queuing behind the click/evaluate they blocked.
+ * Firefox has no equivalent WebExtension API; never patch page JS to fake it.
+ */
+ async startDialogHandling(tabId, { signal, onHandled, timeoutMs = 5000 } = {}) {
+ this.stopDialogHandling(tabId);
+ if (signal?.aborted) return;
+ const owner = { signal, onHandled };
+ owner.onAbort = () => {
+ if (this.dialogRuns.get(tabId) === owner) this.stopDialogHandling(tabId);
+ };
+ this.dialogRuns.set(tabId, owner);
+ signal?.addEventListener('abort', owner.onAbort, { once: true });
+ try {
+ await this.attach(tabId);
+ if (this.dialogRuns.get(tabId) !== owner) return;
+ // Resolve an already-observed dialog before Page.enable, which itself
+ // can wait for the paused renderer when Dev retained the connection.
+ for (const [sessionId, dialog] of this.pendingDialogs.get(tabId) || []) {
+ this._continueJavaScriptDialog(tabId, { tabId, sessionId }, dialog);
+ }
+ // Page.enable can wait indefinitely behind a pre-existing dialog. Stop
+ // must release the run even when Chrome never answers this command.
+ let timer;
+ const interrupted = new Promise((_, reject) => {
+ owner.cancelStartup = () => {
+ const error = new Error('Stopped during browser dialog setup');
+ error.name = 'AbortError';
+ reject(error);
+ };
+ timer = setTimeout(() => {
+ const error = new Error('Browser dialog setup timed out. Dismiss any existing browser dialog and try again.');
+ error.code = 'dialog_startup_timeout';
+ reject(error);
+ }, timeoutMs);
+ });
+ try {
+ await Promise.race([this.sendCommand(tabId, 'Page.enable'), interrupted]);
+ } finally {
+ clearTimeout(timer);
+ delete owner.cancelStartup;
+ }
+ } catch (error) {
+ if (this.dialogRuns.get(tabId) === owner) this.stopDialogHandling(tabId);
+ throw error;
+ }
+ }
+
+ stopDialogHandling(tabId) {
+ const owner = this.dialogRuns.get(tabId);
+ owner?.cancelStartup?.();
+ owner?.signal?.removeEventListener('abort', owner.onAbort);
+ this.dialogRuns.delete(tabId);
+ }
+
+ _continueJavaScriptDialog(tabId, source, params = {}) {
+ const owner = this.dialogRuns.get(tabId);
+ if (!owner || owner.signal?.aborted || params.handling) return;
+ if (!['alert', 'confirm', 'prompt', 'beforeunload'].includes(params.type)) return;
+ params.handling = true;
+ const response = { accept: true };
+ // Use the site's existing default; never invent answers or interpret dialog
+ // text as instructions. No page-controlled text is sent to status/trace UI.
+ if (params.type === 'prompt') response.promptText = String(params.defaultPrompt ?? '');
+ void this.sendCommand(tabId, 'Page.handleJavaScriptDialog', response, source?.sessionId || '')
+ .then(() => {
+ if (this.dialogRuns.get(tabId) !== owner) return;
+ try { owner.onHandled?.(params.type); } catch {}
+ })
+ .catch(() => {
+ // The user may have already closed it, navigated, or detached. Do not
+ // retry: a retry could answer a different dialog opened immediately after.
+ });
+ }
+
/**
* Send a CDP command and get the result.
*/
diff --git a/src/chrome/src/config-transfer.js b/src/chrome/src/config-transfer.js
index 6c469ba01..2096bd61c 100644
--- a/src/chrome/src/config-transfer.js
+++ b/src/chrome/src/config-transfer.js
@@ -51,7 +51,7 @@ export const DEFAULT_CONFIG_SETTINGS = Object.freeze({
completionConfetti: true,
completionFlashTab: true,
tracingEnabled: false,
- strictSecretMode: false,
+ strictSecretMode: true,
agentAllowLocalNetwork: false,
scheduledTasksEnabled: true,
scheduledRequireConsequentialConfirmation: true,
diff --git a/src/chrome/src/ui/locales/ar.js b/src/chrome/src/ui/locales/ar.js
index c81b90b30..ade8ec897 100644
--- a/src/chrome/src/ui/locales/ar.js
+++ b/src/chrome/src/ui/locales/ar.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} حرف',
'st.skills.item.tools': 'الأدوات: {tools}',
'st.skills.remove': 'إزالة',
+ 'st.skills.edit': 'تعديل',
'st.skills.preview.rendered': 'معاينة',
'st.skills.preview.raw': 'خام',
'st.skills.security_html': '<strong>تنبيه:</strong> يتم تخزين المهارات المخصصة كنص عادي في التخزين المحلي للمتصفح وإرسالها إلى مزود LLM الذي قمت بتكوينه كجزء من الموجه النظامي. يمكن لأدوات المهارات المستوردة إرسال مدخلاتها المعلنة إلى نقاط نهاية HTTPS المعلنة دون تأكيد لكل استدعاء؛ أدوات التنزيل لا تزال تطلب عبر بوابة أذونات التنزيلات العادية قبل حفظ الملفات. استورد فقط الأدوات التي تثق بها؛ يتم نسخ المحتوى البعيد إلى التخزين عند الاستيراد.',
diff --git a/src/chrome/src/ui/locales/bn.js b/src/chrome/src/ui/locales/bn.js
index 4d2136321..b78a9e7d7 100644
--- a/src/chrome/src/ui/locales/bn.js
+++ b/src/chrome/src/ui/locales/bn.js
@@ -758,6 +758,7 @@ export default {
'st.skills.item.chars': "{count} অক্ষর",
'st.skills.item.tools': "টুল: {tools}",
'st.skills.remove': "সরান",
+ 'st.skills.edit': 'সম্পাদনা',
'st.skills.cws.heading': "Chrome Web Store রিলিজ সেটআপ",
'st.skills.cws.desc_html': "প্যাকেজ করা রিলিজ দক্ষতা সক্রিয় থাকাকালীনই এই সেটিংসগুলি উপস্থিত হয়৷ একটি Google Cloud OAuth তৈরি করুন৷ <strong>ওয়েব অ্যাপ্লিকেশন</strong>, Chrome Web Store API সক্ষম করুন এবং নিবন্ধন করুন৷ <code>http://localhost:1457/auth/callback</code> একটি অনুমোদিত পুনঃনির্দেশ URI হিসাবে। শংসাপত্র, টোকেন এবং জিপ বাইটগুলি এক্সটেনশন-স্থানীয় সঞ্চয়স্থানে থাকে এবং কখনই মডেল প্রম্পট বা ট্রেসে অন্তর্ভুক্ত হয় না।",
'st.skills.cws.publisher_id': "প্রকাশক আইডি",
diff --git a/src/chrome/src/ui/locales/de.js b/src/chrome/src/ui/locales/de.js
index ee150c2d0..48a245d6f 100644
--- a/src/chrome/src/ui/locales/de.js
+++ b/src/chrome/src/ui/locales/de.js
@@ -898,6 +898,7 @@ export default {
'st.skills.item.chars': '{count} Zeichen',
'st.skills.item.tools': 'Tools: {tools}',
'st.skills.remove': 'Entfernen',
+ 'st.skills.edit': 'Bearbeiten',
'st.skills.preview.rendered': 'Vorschau',
'st.skills.preview.raw': 'Roh',
'st.skills.security_html': '<strong>Hinweis:</strong> Benutzerdefinierte Skills werden als Klartext im Browser-Speicher gespeichert...',
diff --git a/src/chrome/src/ui/locales/en.js b/src/chrome/src/ui/locales/en.js
index 23f0f691f..0d4c1d952 100644
--- a/src/chrome/src/ui/locales/en.js
+++ b/src/chrome/src/ui/locales/en.js
@@ -639,7 +639,7 @@ export default {
'st.display.cost_total_limit.desc': 'Tracks reported or estimated spend for eligible cloud and router model calls across the extension and stops further paid calls at the allowance.',
'st.display.cost_reset': 'Reset spend',
'st.display.strict_secret.label': 'Strict secret handling',
- 'st.display.strict_secret.desc': 'Refuse to quote credentials (passwords, API keys, tokens, OTPs) in summaries or assistant text — even when you explicitly ask for them. Useful if you regularly share trace files or screen-share. Off by default: webbrain runs in your own browser, so by default the agent shows you values you ask for and just keeps `done` summaries tidy.',
+ 'st.display.strict_secret.desc': 'Refuse to quote credentials (passwords, API keys, tokens, OTPs) in summaries or assistant text — even when you explicitly ask for them. Useful if you regularly share trace files or screen-share. On by default: webbrain runs in your own browser, but out of an abundance of care the agent refuses to echo credentials you hold, keeping `done` summaries tidy. Turn it off (Settings → Security) if you sometimes need the agent to echo the exact value you ask for.',
'st.display.allow_local_network.label': 'Allow agent to access local network',
'st.display.allow_local_network.desc': 'Lets the agent\'s fetch_url tool reach loopback (127.0.0.1, localhost) and private/RFC1918 addresses (10.x, 192.168.x, 172.16–31.x). Useful for local dev servers, intranet tools, or self-hosted APIs. Off by default — when off, prompt-injected pages can\'t steer the agent into probing your local network. Cloud-metadata addresses (169.254.169.254) and *.internal/*.local hostnames stay blocked even when on.',
'st.display.scheduled_tasks.label': 'Scheduled tasks',
@@ -759,6 +759,7 @@ export default {
'st.skills.item.chars': '{count} chars',
'st.skills.item.tools': 'Tools: {tools}',
'st.skills.remove': 'Remove',
+ 'st.skills.edit': 'Edit',
'st.skills.cws.heading': 'Chrome Web Store release setup',
'st.skills.cws.desc_html': 'These settings appear only while the packaged release skill is enabled. Create a Google Cloud OAuth <strong>Web application</strong>, enable the Chrome Web Store API, and register <code>http://localhost:1457/auth/callback</code> as an authorized redirect URI. Credentials, tokens, and ZIP bytes stay in extension-local storage and are never included in model prompts or traces.',
'st.skills.cws.publisher_id': 'Publisher ID',
diff --git a/src/chrome/src/ui/locales/es.js b/src/chrome/src/ui/locales/es.js
index fc995b01e..01569c973 100644
--- a/src/chrome/src/ui/locales/es.js
+++ b/src/chrome/src/ui/locales/es.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} caracteres',
'st.skills.item.tools': 'Herramientas: {tools}',
'st.skills.remove': 'Eliminar',
+ 'st.skills.edit': 'Editar',
'st.skills.preview.rendered': 'Vista previa',
'st.skills.preview.raw': 'Sin formato',
'st.skills.security_html': '<strong>Atención:</strong> las habilidades personalizadas se almacenan en texto plano en el almacenamiento local del navegador y se envían a tu proveedor de LLM configurado como parte del prompt del sistema. Las herramientas de habilidad importadas pueden enviar sus entradas declaradas a sus endpoints HTTPS declarados sin confirmación por llamada; las herramientas de descarga siguen preguntando a través de la puerta de permisos de Descargas antes de guardar archivos. Solo importa herramientas en las que confíes; el contenido remoto se copia al almacenamiento en el momento de la importación.',
diff --git a/src/chrome/src/ui/locales/fa.js b/src/chrome/src/ui/locales/fa.js
index 6f5d51f04..69d763bf9 100644
--- a/src/chrome/src/ui/locales/fa.js
+++ b/src/chrome/src/ui/locales/fa.js
@@ -758,6 +758,7 @@ export default {
'st.skills.item.chars': "کاراکترهای {count}",
'st.skills.item.tools': "ابزار: {tools}",
'st.skills.remove': "حذف کنید",
+ 'st.skills.edit': 'ویرایش',
'st.skills.cws.heading': "راه اندازی انتشار Chrome Web Store",
'st.skills.cws.desc_html': "این تنظیمات فقط زمانی ظاهر می شوند که مهارت انتشار بسته بندی شده فعال باشد. یک Google Cloud OAuth ایجاد کنید <strong>برنامه وب</strong>، Chrome Web Store API را فعال کرده و ثبت نام کنید <code>http://localhost:1457/auth/callback</code> به عنوان یک URI تغییر مسیر مجاز. اعتبارنامه‌ها، نشانه‌ها و بایت‌های ZIP در حافظه محلی داخلی باقی می‌مانند و هرگز در پیام‌ها یا ردیابی‌های مدل گنجانده نمی‌شوند.",
'st.skills.cws.publisher_id': "شناسه ناشر",
diff --git a/src/chrome/src/ui/locales/fr.js b/src/chrome/src/ui/locales/fr.js
index c9607b1dc..a4c0d9e33 100644
--- a/src/chrome/src/ui/locales/fr.js
+++ b/src/chrome/src/ui/locales/fr.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} caractères',
'st.skills.item.tools': 'Outils : {tools}',
'st.skills.remove': 'Supprimer',
+ 'st.skills.edit': 'Modifier',
'st.skills.preview.rendered': 'Aperçu',
'st.skills.preview.raw': 'Brut',
'st.skills.security_html': '<strong>Attention :</strong> les compétences personnalisées sont stockées en texte brut dans le stockage local du navigateur et envoyées à votre fournisseur LLM configuré dans le prompt système. Les outils de compétence importés peuvent envoyer leurs entrées déclarées à leurs endpoints HTTPS déclarés sans confirmation par appel ; les outils de téléchargement demandent toujours via la porte de permission de Téléchargements avant d\'enregistrer des fichiers. Importez uniquement les outils auxquels vous faites confiance ; le contenu distant est copié dans le stockage au moment de l\'importation.',
diff --git a/src/chrome/src/ui/locales/he.js b/src/chrome/src/ui/locales/he.js
index 71d0312fe..06210b1c7 100644
--- a/src/chrome/src/ui/locales/he.js
+++ b/src/chrome/src/ui/locales/he.js
@@ -691,6 +691,7 @@ export default {
"st.skills.item.chars": "{count} תווים",
"st.skills.item.tools": "כְּלֵי עֲבוֹדָה: {tools}",
"st.skills.remove": "לְהַסִיר",
+ "st.skills.edit": "עריכה",
"st.skills.preview.rendered": "תצוגה מקדימה",
"st.skills.preview.raw": "מקור",
"st.skills.security_html": "<strong>לתשומת לבך:</strong> מיומנויות מותאמות אישית נשמרות כטקסט גלוי באחסון המקומי של הדפדפן ונשלחות לספק ה-LLM שהגדרת כחלק מהנחיית המערכת. כלים שיובאו עם מיומנות יכולים לשלוח את הקלטים המוצהרים שלהם לנקודות הקצה המוצהרות ב-HTTPS ללא אישור לכל קריאה; כלי הורדה עדיין מבקשים אישור רגיל להורדות לפני שמירת קבצים. ייבא רק כלים שאתה בוטח בהם; תוכן מרוחק מועתק לאחסון בזמן הייבוא.",
diff --git a/src/chrome/src/ui/locales/hi.js b/src/chrome/src/ui/locales/hi.js
index 04f7b92eb..cc9b83698 100644
--- a/src/chrome/src/ui/locales/hi.js
+++ b/src/chrome/src/ui/locales/hi.js
@@ -758,6 +758,7 @@ export default {
'st.skills.item.chars': "{count} वर्ण",
'st.skills.item.tools': "उपकरण: {tools}",
'st.skills.remove': "हटाओ",
+ 'st.skills.edit': 'संपादित करें',
'st.skills.cws.heading': "Chrome Web Store रिलीज़ सेटअप",
'st.skills.cws.desc_html': "ये सेटिंग्स केवल तभी दिखाई देती हैं जब पैकेज्ड रिलीज़ कौशल सक्षम होता है। एक Google क्लाउड OAuth बनाएं <strong>वेब अनुप्रयोग</strong>, Chrome Web Store API सक्षम करें, और रजिस्टर करें <code>http://localhost:1457/auth/callback</code> एक अधिकृत रीडायरेक्ट यूआरआई के रूप में। क्रेडेंशियल, टोकन और ज़िप बाइट्स एक्सटेंशन-लोकल स्टोरेज में रहते हैं और मॉडल प्रॉम्प्ट या ट्रेस में कभी शामिल नहीं होते हैं।",
'st.skills.cws.publisher_id': "प्रकाशक आईडी",
diff --git a/src/chrome/src/ui/locales/id.js b/src/chrome/src/ui/locales/id.js
index 9cc3cec09..a6d8f787b 100644
--- a/src/chrome/src/ui/locales/id.js
+++ b/src/chrome/src/ui/locales/id.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} karakter',
'st.skills.item.tools': 'Alat: {tools}',
'st.skills.remove': 'Hapus',
+ 'st.skills.edit': 'Edit',
'st.skills.preview.rendered': 'Pratinjau',
'st.skills.preview.raw': 'Mentah',
'st.skills.security_html': '<strong>Perhatian:</strong> keterampilan kustom disimpan dalam teks biasa di penyimpanan lokal browser dan dikirim ke penyedia LLM yang Anda konfigurasi sebagai bagian dari prompt sistem. Alat keterampilan yang diimpor dapat mengirim input yang dideklarasikan ke endpoint HTTPS yang dideklarasikan tanpa konfirmasi per panggilan; alat unduh tetap meminta melalui gerbang izin Unduhan normal sebelum menyimpan file. Hanya impor alat yang Anda percayai; konten jarak jauh disalin ke penyimpanan saat impor.',
diff --git a/src/chrome/src/ui/locales/ja.js b/src/chrome/src/ui/locales/ja.js
index 514039701..802da6164 100644
--- a/src/chrome/src/ui/locales/ja.js
+++ b/src/chrome/src/ui/locales/ja.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} 文字',
'st.skills.item.tools': 'ツール: {tools}',
'st.skills.remove': '削除',
+ 'st.skills.edit': '編集',
'st.skills.preview.rendered': 'プレビュー',
'st.skills.preview.raw': 'ソース',
'st.skills.security_html': '<strong>注意:</strong> カスタムスキルはブラウザのローカルストレージに平文で保存され、システムプロンプトの一部として設定済みのLLMプロバイダーに送信されます。インポートされたスキルツールは、宣言された入力を宣言されたHTTPSエンドポイントに呼び出しごとの確認なしで送信できます。ダウンロードツールはファイル保存前に通常のダウンロード許可ゲートを通じて確認します。信頼するツールのみをインポートしてください。リモートコンテンツはインポート時にストレージにコピーされます。',
diff --git a/src/chrome/src/ui/locales/ko.js b/src/chrome/src/ui/locales/ko.js
index 1bf2d6956..d7cceae7e 100644
--- a/src/chrome/src/ui/locales/ko.js
+++ b/src/chrome/src/ui/locales/ko.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count}자',
'st.skills.item.tools': '도구: {tools}',
'st.skills.remove': '제거',
+ 'st.skills.edit': '수정',
'st.skills.preview.rendered': '미리보기',
'st.skills.preview.raw': '원문',
'st.skills.security_html': '<strong>알림:</strong> 사용자 정의 스킬은 브라우저 로컬 스토리지에 일반 텍스트로 저장되며 시스템 프롬프트의 일부로 구성된 LLM 제공업체에 전송됩니다. 가져온 스킬 도구는 호출별 확인 없이 선언된 입력을 선언된 HTTPS 엔드포인트로 보낼 수 있습니다. 다운로드 도구는 파일 저장 전에 일반 다운로드 권한 게이트를 통해 계속 확인합니다. 신뢰하는 도구만 가져오세요. 원격 콘텐츠는 가져올 때 스토리지에 복사됩니다.',
diff --git a/src/chrome/src/ui/locales/ms.js b/src/chrome/src/ui/locales/ms.js
index a7969f12a..645fd4a31 100644
--- a/src/chrome/src/ui/locales/ms.js
+++ b/src/chrome/src/ui/locales/ms.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} aksara',
'st.skills.item.tools': 'Alatan: {tools}',
'st.skills.remove': 'Alih keluar',
+ 'st.skills.edit': 'Edit',
'st.skills.preview.rendered': 'Pratonton',
'st.skills.preview.raw': 'Mentah',
'st.skills.security_html': '<strong>Awas:</strong> kemahiran tersuai disimpan dalam teks biasa dalam storan tempatan pelayar dan dihantar kepada pembekal LLM yang anda konfigurasikan sebagai sebahagian daripada prompt sistem. Alatan kemahiran yang diimport boleh menghantar input yang diisytiharkan ke titik akhir HTTPS yang diisytiharkan tanpa pengesahan setiap panggilan; alatan muat turun masih meminta melalui gerbang kebenaran Muat Turun biasa sebelum menyimpan fail. Hanya import alatan yang anda percayai; kandungan jauh disalin ke storan semasa import.',
diff --git a/src/chrome/src/ui/locales/nl.js b/src/chrome/src/ui/locales/nl.js
index bdce860eb..57791cd47 100644
--- a/src/chrome/src/ui/locales/nl.js
+++ b/src/chrome/src/ui/locales/nl.js
@@ -692,6 +692,7 @@ export default {
'st.skills.item.chars': '{count} tekens',
'st.skills.item.tools': 'Tools: {tools}',
'st.skills.remove': 'Verwijderen',
+ 'st.skills.edit': 'Bewerken',
'st.skills.preview.rendered': 'Voorbeeld',
'st.skills.preview.raw': 'Ruw',
'st.skills.security_html': '<strong>Let op:</strong> aangepaste vaardigheden worden in platte tekst opgeslagen...',
diff --git a/src/chrome/src/ui/locales/pl.js b/src/chrome/src/ui/locales/pl.js
index 130ed06ae..1b37d2e4a 100644
--- a/src/chrome/src/ui/locales/pl.js
+++ b/src/chrome/src/ui/locales/pl.js
@@ -709,6 +709,7 @@ export default {
'st.skills.item.chars': '{count} znaków',
'st.skills.item.tools': 'Narzędzia: {tools}',
'st.skills.remove': 'Usuń',
+ 'st.skills.edit': 'Edytuj',
'st.skills.preview.rendered': 'Podgląd',
'st.skills.preview.raw': 'Surowy tekst',
'st.skills.security_html': '<strong>Uwaga:</strong> niestandardowe umiejętności są przechowywane w postaci zwykłego tekstu w lokalnym magazynie przeglądarki i wysyłane do skonfigurowanego dostawcy LLM jako część promptu systemowego. Zaimportowane narzędzia umiejętności mogą wysyłać swoje zadeklarowane dane wejściowe do zadeklarowanych punktów końcowych HTTPS bez potwierdzenia na każde wywołanie; narzędzia do pobierania nadal pytają przez normalną bramę uprawnień Pobierania przed zapisaniem plików. Importuj tylko narzędzia, którym ufasz; zdalna treść jest kopiowana do magazynu podczas importu.',
diff --git a/src/chrome/src/ui/locales/pt.js b/src/chrome/src/ui/locales/pt.js
index 9e61fc25f..76499188a 100644
--- a/src/chrome/src/ui/locales/pt.js
+++ b/src/chrome/src/ui/locales/pt.js
@@ -758,6 +758,7 @@ export default {
'st.skills.item.chars': "Caracteres {count}",
'st.skills.item.tools': "Ferramentas: {tools}",
'st.skills.remove': "Remover",
+ 'st.skills.edit': 'Editar',
'st.skills.cws.heading': "Configuração de versão Chrome Web Store",
'st.skills.cws.desc_html': "Essas configurações aparecem apenas enquanto a habilidade de liberação do pacote está habilitada. Crie um Google Cloud OAuth <strong>Aplicativo web</strong>, ative a API Chrome Web Store e registre-se <code>http://localhost:1457/auth/callback</code> como um URI de redirecionamento autorizado. Credenciais, tokens e bytes ZIP permanecem no armazenamento local de extensão e nunca são incluídos em prompts ou rastreamentos de modelo.",
'st.skills.cws.publisher_id': "ID do editor",
diff --git a/src/chrome/src/ui/locales/ru.js b/src/chrome/src/ui/locales/ru.js
index 9643a6de1..cb81f63f3 100644
--- a/src/chrome/src/ui/locales/ru.js
+++ b/src/chrome/src/ui/locales/ru.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} символов',
'st.skills.item.tools': 'Инструменты: {tools}',
'st.skills.remove': 'Удалить',
+ 'st.skills.edit': 'Редактировать',
'st.skills.preview.rendered': 'Предпросмотр',
'st.skills.preview.raw': 'Исходник',
'st.skills.security_html': '<strong>Внимание:</strong> пользовательские навыки хранятся в открытом тексте в локальном хранилище браузера и отправляются вашему настроенному LLM-провайдеру как часть системного промпта. Импортированные инструменты навыков могут отправлять свои объявленные входные данные на свои объявленные HTTPS-эндоинты без подтверждения каждого вызова; инструменты загрузки всё равно запрашивают разрешение через обычный шлюз разрешений Загрузок перед сохранением файлов. Импортируйте только те инструменты, которым вы доверяете; удалённое содержимое копируется в хранилище при импорте.',
diff --git a/src/chrome/src/ui/locales/th.js b/src/chrome/src/ui/locales/th.js
index c3cda8251..f0422d189 100644
--- a/src/chrome/src/ui/locales/th.js
+++ b/src/chrome/src/ui/locales/th.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} ตัวอักษร',
'st.skills.item.tools': 'เครื่องมือ: {tools}',
'st.skills.remove': 'ลบ',
+ 'st.skills.edit': 'แก้ไข',
'st.skills.preview.rendered': 'ตัวอย่าง',
'st.skills.preview.raw': 'ต้นฉบับ',
'st.skills.security_html': '<strong>ข้อควรระวัง:</strong> ทักษะที่กำหนดเองจะถูกเก็บเป็นข้อความธรรมดาในพื้นที่จัดเก็บของเบราว์เซอร์และส่งไปยังผู้ให้บริการ LLM ที่คุณกำหนดค่าไว้เป็นส่วนหนึ่งของระบบพรอมพ์ เครื่องมือทักษะที่นำเข้าสามารถส่งอินพุตที่ประกาศไปยังปลายทาง HTTPS ที่ประกาศไว้โดยไม่ต้องยืนยันทุกครั้ง เครื่องมือดาวน์โหลดยังคงขอผ่านประตูอนุญาตการดาวน์โหลดปกติก่อนบันทึกไฟล์ นำเข้าเฉพาะเครื่องมือที่คุณเชื่อถือ เนื้อหาระยะไกลจะถูกคัดลอกไปยังพื้นที่จัดเก็บเมื่อนำเข้า',
diff --git a/src/chrome/src/ui/locales/tl.js b/src/chrome/src/ui/locales/tl.js
index c81505058..10a6b971d 100644
--- a/src/chrome/src/ui/locales/tl.js
+++ b/src/chrome/src/ui/locales/tl.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} karakter',
'st.skills.item.tools': 'Mga tool: {tools}',
'st.skills.remove': 'Alisin',
+ 'st.skills.edit': 'I-edit',
'st.skills.preview.rendered': 'Paunang tingin',
'st.skills.preview.raw': 'Hilaw',
'st.skills.security_html': '<strong>Paalala:</strong> ang mga custom na kasanayan ay naka-store bilang plaintext sa browser local storage at ipinapadala sa iyong na-configure na LLM provider bilang bahagi ng system prompt. Ang mga na-import na tool ng kasanayan ay maaaring magpadala ng kanilang mga declared input sa kanilang declared HTTPS endpoint nang walang per-call confirmation; ang mga download tool ay humihingi pa rin sa pamamagitan ng normal na Downloads permission gate bago mag-save ng mga file. Ang mga tool lang na pinagkakatiwalaan mo ang i-import; ang remote na content ay kinokopya sa storage sa oras ng pag-import.',
diff --git a/src/chrome/src/ui/locales/tr.js b/src/chrome/src/ui/locales/tr.js
index 61df15a3b..cbd14911e 100644
--- a/src/chrome/src/ui/locales/tr.js
+++ b/src/chrome/src/ui/locales/tr.js
@@ -86,6 +86,7 @@ export default {
'st.skills.item.chars': '{count} karakter',
'st.skills.item.tools': 'Tool\'lar: {tools}',
'st.skills.remove': 'Kaldır',
+ 'st.skills.edit': 'Düzenle',
'st.skills.preview.rendered': 'Önizleme',
'st.skills.preview.raw': 'Ham',
'st.skills.security_html': '<strong>Dikkat:</strong> özel skill\'ler tarayıcı yerel depolamasında düz metin olarak saklanır. Mid/Full katmanlarında uygun adlar ve özetler küçük bir yükleyici kataloğu olarak yapılandırdığın LLM sağlayıcısına gönderilir; tam talimatlar yalnızca skill o çalışma için yüklendikten sonra gönderilir. İçe aktarılan skill tool\'ları daha sonra, çağrı başına tekrar onay istemeden beyan edilen girdileri beyan edilen HTTPS endpoint\'lerine gönderebilir; download tool\'ları dosya kaydetmeden önce normal Downloads izin akışını kullanır. Yalnızca güvendiğin tool\'ları içe aktar; uzak içerik içe aktarma sırasında depoya kopyalanır.',
diff --git a/src/chrome/src/ui/locales/uk.js b/src/chrome/src/ui/locales/uk.js
index ba2fd1318..9e60eca34 100644
--- a/src/chrome/src/ui/locales/uk.js
+++ b/src/chrome/src/ui/locales/uk.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} символів',
'st.skills.item.tools': 'Інструменти: {tools}',
'st.skills.remove': 'Видалити',
+ 'st.skills.edit': 'Редагувати',
'st.skills.preview.rendered': 'Перегляд',
'st.skills.preview.raw': 'Оригінал',
'st.skills.security_html': '<strong>Увага:</strong> власні навички зберігаються у відкритому тексті в локальному сховищі браузера та надсилаються вашому налаштованому LLM-провайдеру як частина системного промпту. Імпортовані інструменти навичок можуть надсилати свої оголошені вхідні дані на свої оголошені HTTPS-ендпоінти без підтвердження кожного виклику; інструменти завантаження все одно запитують через звичайний шлюз дозволів Завантажень перед збереженням файлів. Імпортуйте лише ті інструменти, яким ви довіряєте; віддалений вміст копіюється в сховище під час імпорту.',
diff --git a/src/chrome/src/ui/locales/vi.js b/src/chrome/src/ui/locales/vi.js
index 17592ed6c..d9c0e175d 100644
--- a/src/chrome/src/ui/locales/vi.js
+++ b/src/chrome/src/ui/locales/vi.js
@@ -758,6 +758,7 @@ export default {
'st.skills.item.chars': "Ký tự {count}",
'st.skills.item.tools': "Dụng cụ: {tools}",
'st.skills.remove': "Xóa",
+ 'st.skills.edit': 'Chỉnh sửa',
'st.skills.cws.heading': "Thiết lập phát hành Chrome Web Store",
'st.skills.cws.desc_html': "Các cài đặt này chỉ xuất hiện khi kỹ năng phát hành đóng gói được bật. Tạo OAuth trên đám mây của Google <strong>Ứng dụng web</strong>, kích hoạt API Chrome Web Store và đăng ký <code>http://localhost:1457/auth/callback</code> dưới dạng URI chuyển hướng được ủy quyền. Thông tin xác thực, mã thông báo và byte ZIP vẫn nằm trong bộ nhớ cục bộ của tiện ích mở rộng và không bao giờ được đưa vào lời nhắc hoặc dấu vết mô hình.",
'st.skills.cws.publisher_id': "Mã nhà xuất bản",
diff --git a/src/chrome/src/ui/locales/zh.js b/src/chrome/src/ui/locales/zh.js
index 3c7c32943..05373e73f 100644
--- a/src/chrome/src/ui/locales/zh.js
+++ b/src/chrome/src/ui/locales/zh.js
@@ -718,6 +718,7 @@ export default {
'st.skills.item.chars': '{count} 个字符',
'st.skills.item.tools': '工具:{tools}',
'st.skills.remove': '移除',
+ 'st.skills.edit': '编辑',
'st.skills.preview.rendered': '预览',
'st.skills.preview.raw': '原始文本',
'st.skills.security_html': '<strong>注意:</strong>自定义技能以纯文本形式存储在浏览器本地存储中,并作为系统提示的一部分发送给您配置的 LLM 提供商。导入的技能工具可以在没有每次调用确认的情况下将其声明的输入发送到其声明的 HTTPS 端点;下载工具在保存文件之前仍会通过正常的下载权限门询问。只导入您信任的工具;远程内容在导入时会被复制到存储中。',
diff --git a/src/chrome/src/ui/settings.js b/src/chrome/src/ui/settings.js
index eef5740b8..0a97a29b2 100644
--- a/src/chrome/src/ui/settings.js
+++ b/src/chrome/src/ui/settings.js
@@ -738,6 +738,7 @@ function boundedMaxAgentSteps(value) {
let providerFilter = 'all'; // 'all' | 'active' | 'local' | 'cloud' | 'router'
let providerSearchQuery = '';
const expandedProviders = new Set(); // ids the user explicitly expanded this session
+let editingSkillId = null;
let customSkills = [];
let skillPreviewRequestId = 0;
const DEFAULT_SKILL_IDS = new Set(DEFAULT_SKILL_SOURCES.map((source) => source.id));
@@ -873,7 +874,7 @@ async function init() {
if (costTotalLimitInput) costTotalLimitInput.value = totalLimit.toFixed(2);
renderCostAllowanceSpent(totalSpent, totalLimit);
if (strictSecretToggle) {
- strictSecretToggle.checked = stored.strictSecretMode === true; // off by default
+ strictSecretToggle.checked = stored.strictSecretMode !== false; // on by default
}
if (allowLocalNetworkToggle) {
allowLocalNetworkToggle.checked = stored.agentAllowLocalNetwork === true; // off by default
@@ -1224,6 +1225,7 @@ function renderSkills() {
data-skill-preview-id="${escapeHtml(skill.id)}">${escapeHtml(skill.name)}</button>
<div class="setting-desc skill-source">${escapeHtml(source)} · ${escapeHtml(t('st.skills.item.chars', { count: skill.content.length }))}${escapeHtml(toolSummary)}</div>
</div>
+ <button class="btn-secondary" data-skill-edit-id="${escapeHtml(skill.id)}">${escapeHtml(t('st.skills.edit'))}</button>
<button class="btn-secondary" data-skill-id="${escapeHtml(skill.id)}">${escapeHtml(t('st.skills.remove'))}</button>
</div>`;
}).join('');
@@ -1231,8 +1233,17 @@ function renderSkills() {
skillsList.querySelectorAll('button[data-skill-preview-id]').forEach((btn) => {
btn.addEventListener('click', () => previewEnabledSkill(btn.dataset.skillPreviewId));
});
+ skillsList.querySelectorAll('button[data-skill-edit-id]').forEach((btn) => {
+ btn.addEventListener('click', () => {
+ const skill = customSkills.find((s) => s.id === btn.dataset.skillEditId);
+ if (skill) startSkillEdit(skill);
+ });
+ });
skillsList.querySelectorAll('button[data-skill-id]').forEach((btn) => {
btn.addEventListener('click', async () => {
+ if (editingSkillId === btn.dataset.skillId) {
+ cancelSkillEdit();
+ }
const removedSkill = customSkills.find((skill) => skill.id === btn.dataset.skillId);
await saveCustomSkills(
customSkills.filter((skill) => skill.id !== btn.dataset.skillId),
@@ -1275,6 +1286,24 @@ async function addPackagedSkill(skillId, button) {
}
}
+function startSkillEdit(skill) {
+ editingSkillId = skill.id;
+ if (skillNameInput) skillNameInput.value = skill.name || '';
+ if (skillTextArea) skillTextArea.value = skill.content || '';
+ if (btnAddSkillText) btnAddSkillText.textContent = t('st.providers.save');
+ flashSkillsResult('ok', skill.name || t('st.skills.edit'));
+ skillNameInput?.focus?.();
+ if (skillTextArea) skillTextArea.scrollIntoView({ behavior: 'smooth', block: 'center' });
+}
+
+function cancelSkillEdit() {
+ if (editingSkillId == null) return;
+ editingSkillId = null;
+ if (btnAddSkillText) btnAddSkillText.textContent = t('st.skills.add_text');
+ if (skillNameInput) skillNameInput.value = '';
+ if (skillTextArea) skillTextArea.value = '';
+}
+
async function addSkillFromText() {
const content = (skillTextArea?.value || '').trim();
if (!content) {
@@ -1282,6 +1311,23 @@ async function addSkillFromText() {
return;
}
try {
+ if (editingSkillId) {
+ const original = customSkills.find((s) => s.id === editingSkillId);
+ if (!original) {
+ cancelSkillEdit();
+ throw new Error(t('st.skills.error.add_failed'));
+ }
+ const updated = {
+ ...original,
+ name: (skillNameInput?.value || '').trim() || original.name || '',
+ content,
+ };
+ const next = customSkills.map((s) => (s.id === editingSkillId ? updated : s));
+ await saveCustomSkills(next);
+ cancelSkillEdit();
+ flashSkillsResult('ok', t('st.providers.saved'));
+ return;
+ }
await addCustomSkill({
id: makeSkillId(),
name: skillNameInput?.value || '',
@@ -1351,6 +1397,7 @@ async function addSkillFromUrl() {
btnAddSkillText?.addEventListener('click', addSkillFromText);
btnAddSkillUrl?.addEventListener('click', addSkillFromUrl);
btnClearSkillForm?.addEventListener('click', () => {
+ cancelSkillEdit();
if (skillNameInput) skillNameInput.value = '';
if (skillUrlInput) skillUrlInput.value = '';
if (skillTextArea) skillTextArea.value = '';
diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.js
index fa89aa611..54cafd351 100644
--- a/src/firefox/src/agent/agent.js
+++ b/src/firefox/src/agent/agent.js
@@ -873,7 +873,7 @@ export class Agent extends LoopDetector {
this._continuationExecutionEvidence = new Map(); // tabId → app-owned evidence carried only by continueProcessing()
this._continuationResponseLanguagePolicies = new Map(); // tabId -> trusted policy carried only by continueProcessing()
// Strict secret-handling mode — see chrome/agent.js for rationale.
- // Default off; user opts in via Settings → "Strict secret handling".
+ // Defaults to true at extension runtime via background.js and Settings.
this.strictSecretMode = false;
this._lastAxScopes = new Map(); // tabId -> { documentToken, pageUrl }, captured by the latest AX read
this._uncertainTextMutations = new Map(); // tabId -> Map(target -> unresolved, potentially applied text write; no raw text)
diff --git a/src/firefox/src/background.js b/src/firefox/src/background.js
index 831dc313d..426ba9d16 100644
--- a/src/firefox/src/background.js
+++ b/src/firefox/src/background.js
@@ -449,7 +449,7 @@ const researchEscalationReady = loadResearchEscalation().catch(() => {});
async function loadStrictSecretMode() {
const stored = await browser.storage.local.get('strictSecretMode');
- if (stored.strictSecretMode != null) agent.strictSecretMode = !!stored.strictSecretMode;
+ agent.strictSecretMode = stored.strictSecretMode !== false;
}
loadStrictSecretMode();
diff --git a/src/firefox/src/config-transfer.js b/src/firefox/src/config-transfer.js
index 6c469ba01..2096bd61c 100644
--- a/src/firefox/src/config-transfer.js
+++ b/src/firefox/src/config-transfer.js
@@ -51,7 +51,7 @@ export const DEFAULT_CONFIG_SETTINGS = Object.freeze({
completionConfetti: true,
completionFlashTab: true,
tracingEnabled: false,
- strictSecretMode: false,
+ strictSecretMode: true,
agentAllowLocalNetwork: false,
scheduledTasksEnabled: true,
scheduledRequireConsequentialConfirmation: true,
diff --git a/src/firefox/src/ui/locales/ar.js b/src/firefox/src/ui/locales/ar.js
index 5b4579cdb..7b8b1ea35 100644
--- a/src/firefox/src/ui/locales/ar.js
+++ b/src/firefox/src/ui/locales/ar.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} حرف',
'st.skills.item.tools': 'الأدوات: {tools}',
'st.skills.remove': 'إزالة',
+ 'st.skills.edit': 'تعديل',
'st.skills.preview.rendered': 'معاينة',
'st.skills.preview.raw': 'خام',
'st.skills.security_html': '<strong>تنبيه:</strong> يتم تخزين المهارات المخصصة كنص عادي في التخزين المحلي للمتصفح وإرسالها إلى مزود LLM الذي قمت بتكوينه كجزء من الموجه النظامي. يمكن لأدوات المهارات المستوردة إرسال مدخلاتها المعلنة إلى نقاط نهاية HTTPS المعلنة دون تأكيد لكل استدعاء؛ أدوات التنزيل لا تزال تطلب عبر بوابة أذونات التنزيلات العادية قبل حفظ الملفات. استورد فقط الأدوات التي تثق بها؛ يتم نسخ المحتوى البعيد إلى التخزين عند الاستيراد.',
diff --git a/src/firefox/src/ui/locales/bn.js b/src/firefox/src/ui/locales/bn.js
index 634dc397f..9573fbeca 100644
--- a/src/firefox/src/ui/locales/bn.js
+++ b/src/firefox/src/ui/locales/bn.js
@@ -744,6 +744,7 @@ export default {
'st.skills.item.chars': "{count} অক্ষর",
'st.skills.item.tools': "টুল: {tools}",
'st.skills.remove': "সরান",
+ 'st.skills.edit': 'সম্পাদনা',
'st.skills.cws.heading': "Chrome Web Store রিলিজ সেটআপ",
'st.skills.cws.desc_html': "প্যাকেজ করা রিলিজ দক্ষতা সক্রিয় থাকাকালীনই এই সেটিংসগুলি উপস্থিত হয়৷ একটি Google Cloud OAuth তৈরি করুন৷ <strong>ওয়েব অ্যাপ্লিকেশন</strong>, Chrome Web Store API সক্ষম করুন এবং নিবন্ধন করুন৷ <code>http://localhost:1457/auth/callback</code> একটি অনুমোদিত পুনঃনির্দেশ URI হিসাবে। শংসাপত্র, টোকেন এবং জিপ বাইটগুলি এক্সটেনশন-স্থানীয় সঞ্চয়স্থানে থাকে এবং কখনই মডেল প্রম্পট বা ট্রেসে অন্তর্ভুক্ত হয় না।",
'st.skills.cws.publisher_id': "প্রকাশক আইডি",
diff --git a/src/firefox/src/ui/locales/de.js b/src/firefox/src/ui/locales/de.js
index efd6907b6..351a79f22 100644
--- a/src/firefox/src/ui/locales/de.js
+++ b/src/firefox/src/ui/locales/de.js
@@ -877,6 +877,7 @@ export default {
'st.skills.item.chars': '{count} Zeichen',
'st.skills.item.tools': 'Tools: {tools}',
'st.skills.remove': 'Entfernen',
+ 'st.skills.edit': 'Bearbeiten',
'st.skills.preview.rendered': 'Vorschau',
'st.skills.preview.raw': 'Roh',
'st.skills.security_html': '<strong>Hinweis:</strong> Benutzerdefinierte Skills werden als Klartext im Browser-Speicher gespeichert...',
diff --git a/src/firefox/src/ui/locales/en.js b/src/firefox/src/ui/locales/en.js
index 4b6a25ccc..615deae6e 100644
--- a/src/firefox/src/ui/locales/en.js
+++ b/src/firefox/src/ui/locales/en.js
@@ -625,7 +625,7 @@ export default {
'st.display.cost_total_limit.desc': 'Tracks reported or estimated spend for eligible cloud and router model calls across the extension and stops further paid calls at the allowance.',
'st.display.cost_reset': 'Reset spend',
'st.display.strict_secret.label': 'Strict secret handling',
- 'st.display.strict_secret.desc': 'Refuse to quote credentials (passwords, API keys, tokens, OTPs) in summaries or assistant text — even when you explicitly ask for them. Useful if you regularly share trace files or screen-share. Off by default: webbrain runs in your own browser, so by default the agent shows you values you ask for and just keeps `done` summaries tidy.',
+ 'st.display.strict_secret.desc': 'Refuse to quote credentials (passwords, API keys, tokens, OTPs) in summaries or assistant text — even when you explicitly ask for them. Useful if you regularly share trace files or screen-share. On by default: webbrain runs in your own browser, but out of an abundance of care the agent refuses to echo credentials you hold, keeping `done` summaries tidy. Turn it off (Settings → Security) if you sometimes need the agent to echo the exact value you ask for.',
'st.display.allow_local_network.label': 'Allow agent to access local network',
'st.display.allow_local_network.desc': 'Lets the agent\'s fetch_url tool reach loopback (127.0.0.1, localhost) and private/RFC1918 addresses (10.x, 192.168.x, 172.16–31.x). Useful for local dev servers, intranet tools, or self-hosted APIs. Off by default — when off, prompt-injected pages can\'t steer the agent into probing your local network. Cloud-metadata addresses (169.254.169.254) and *.internal/*.local hostnames stay blocked even when on.',
'st.display.scheduled_tasks.label': 'Scheduled tasks',
@@ -745,6 +745,7 @@ export default {
'st.skills.item.chars': '{count} chars',
'st.skills.item.tools': 'Tools: {tools}',
'st.skills.remove': 'Remove',
+ 'st.skills.edit': 'Edit',
'st.skills.cws.heading': 'Chrome Web Store release setup',
'st.skills.cws.desc_html': 'These settings appear only while the packaged release skill is enabled. Create a Google Cloud OAuth <strong>Web application</strong>, enable the Chrome Web Store API, and register <code>http://localhost:1457/auth/callback</code> as an authorized redirect URI. Credentials, tokens, and ZIP bytes stay in extension-local storage and are never included in model prompts or traces.',
'st.skills.cws.publisher_id': 'Publisher ID',
diff --git a/src/firefox/src/ui/locales/es.js b/src/firefox/src/ui/locales/es.js
index 851562c3f..2f2be0418 100644
--- a/src/firefox/src/ui/locales/es.js
+++ b/src/firefox/src/ui/locales/es.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} caracteres',
'st.skills.item.tools': 'Herramientas: {tools}',
'st.skills.remove': 'Eliminar',
+ 'st.skills.edit': 'Editar',
'st.skills.preview.rendered': 'Vista previa',
'st.skills.preview.raw': 'Sin formato',
'st.skills.security_html': '<strong>Atención:</strong> las habilidades personalizadas se almacenan en texto plano en el almacenamiento local del navegador y se envían a tu proveedor de LLM configurado como parte del prompt del sistema. Las herramientas de habilidad importadas pueden enviar sus entradas declaradas a sus endpoints HTTPS declarados sin confirmación por llamada; las herramientas de descarga siguen preguntando a través de la puerta de permisos de Descargas antes de guardar archivos. Solo importa herramientas en las que confíes; el contenido remoto se copia al almacenamiento en el momento de la importación.',
diff --git a/src/firefox/src/ui/locales/fa.js b/src/firefox/src/ui/locales/fa.js
index 4e1aa4f9f..1806a73f7 100644
--- a/src/firefox/src/ui/locales/fa.js
+++ b/src/firefox/src/ui/locales/fa.js
@@ -744,6 +744,7 @@ export default {
'st.skills.item.chars': "کاراکترهای {count}",
'st.skills.item.tools': "ابزار: {tools}",
'st.skills.remove': "حذف کنید",
+ 'st.skills.edit': 'ویرایش',
'st.skills.cws.heading': "راه اندازی انتشار Chrome Web Store",
'st.skills.cws.desc_html': "این تنظیمات فقط زمانی ظاهر می شوند که مهارت انتشار بسته بندی شده فعال باشد. یک Google Cloud OAuth ایجاد کنید <strong>برنامه وب</strong>، Chrome Web Store API را فعال کرده و ثبت نام کنید <code>http://localhost:1457/auth/callback</code> به عنوان یک URI تغییر مسیر مجاز. اعتبارنامه‌ها، نشانه‌ها و بایت‌های ZIP در حافظه محلی داخلی باقی می‌مانند و هرگز در پیام‌ها یا ردیابی‌های مدل گنجانده نمی‌شوند.",
'st.skills.cws.publisher_id': "شناسه ناشر",
diff --git a/src/firefox/src/ui/locales/fr.js b/src/firefox/src/ui/locales/fr.js
index 88e6ead43..4d4e41d89 100644
--- a/src/firefox/src/ui/locales/fr.js
+++ b/src/firefox/src/ui/locales/fr.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} caractères',
'st.skills.item.tools': 'Outils : {tools}',
'st.skills.remove': 'Supprimer',
+ 'st.skills.edit': 'Modifier',
'st.skills.preview.rendered': 'Aperçu',
'st.skills.preview.raw': 'Brut',
'st.skills.security_html': '<strong>Attention :</strong> les compétences personnalisées sont stockées en texte brut dans le stockage local du navigateur et envoyées à votre fournisseur LLM configuré dans le prompt système. Les outils de compétence importés peuvent envoyer leurs entrées déclarées à leurs endpoints HTTPS déclarés sans confirmation par appel ; les outils de téléchargement demandent toujours via la porte de permission de Téléchargements avant d\'enregistrer des fichiers. Importez uniquement les outils auxquels vous faites confiance ; le contenu distant est copié dans le stockage au moment de l\'importation.',
diff --git a/src/firefox/src/ui/locales/he.js b/src/firefox/src/ui/locales/he.js
index 4a81ac99a..62a2ef088 100644
--- a/src/firefox/src/ui/locales/he.js
+++ b/src/firefox/src/ui/locales/he.js
@@ -670,6 +670,7 @@ export default {
"st.skills.item.chars": "{count} תווים",
"st.skills.item.tools": "כְּלֵי עֲבוֹדָה: {tools}",
"st.skills.remove": "לְהַסִיר",
+ "st.skills.edit": "עריכה",
"st.skills.preview.rendered": "תצוגה מקדימה",
"st.skills.preview.raw": "מקור",
"st.skills.security_html": "<strong>לתשומת לבך:</strong> מיומנויות מותאמות אישית נשמרות כטקסט גלוי באחסון המקומי של הדפדפן ונשלחות לספק ה-LLM שהגדרת כחלק מהנחיית המערכת. כלים שיובאו עם מיומנות יכולים לשלוח את הקלטים המוצהרים שלהם לנקודות הקצה המוצהרות ב-HTTPS ללא אישור לכל קריאה; כלי הורדה עדיין מבקשים אישור רגיל להורדות לפני שמירת קבצים. ייבא רק כלים שאתה בוטח בהם; תוכן מרוחק מועתק לאחסון בזמן הייבוא.",
diff --git a/src/firefox/src/ui/locales/hi.js b/src/firefox/src/ui/locales/hi.js
index 368eb6a53..af5d8c51b 100644
--- a/src/firefox/src/ui/locales/hi.js
+++ b/src/firefox/src/ui/locales/hi.js
@@ -744,6 +744,7 @@ export default {
'st.skills.item.chars': "{count} वर्ण",
'st.skills.item.tools': "उपकरण: {tools}",
'st.skills.remove': "हटाओ",
+ 'st.skills.edit': 'संपादित करें',
'st.skills.cws.heading': "Chrome Web Store रिलीज़ सेटअप",
'st.skills.cws.desc_html': "ये सेटिंग्स केवल तभी दिखाई देती हैं जब पैकेज्ड रिलीज़ कौशल सक्षम होता है। एक Google क्लाउड OAuth बनाएं <strong>वेब अनुप्रयोग</strong>, Chrome Web Store API सक्षम करें, और रजिस्टर करें <code>http://localhost:1457/auth/callback</code> एक अधिकृत रीडायरेक्ट यूआरआई के रूप में। क्रेडेंशियल, टोकन और ज़िप बाइट्स एक्सटेंशन-लोकल स्टोरेज में रहते हैं और मॉडल प्रॉम्प्ट या ट्रेस में कभी शामिल नहीं होते हैं।",
'st.skills.cws.publisher_id': "प्रकाशक आईडी",
diff --git a/src/firefox/src/ui/locales/id.js b/src/firefox/src/ui/locales/id.js
index 8a03d99d7..f30641fcb 100644
--- a/src/firefox/src/ui/locales/id.js
+++ b/src/firefox/src/ui/locales/id.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} karakter',
'st.skills.item.tools': 'Alat: {tools}',
'st.skills.remove': 'Hapus',
+ 'st.skills.edit': 'Edit',
'st.skills.preview.rendered': 'Pratinjau',
'st.skills.preview.raw': 'Mentah',
'st.skills.security_html': '<strong>Perhatian:</strong> keterampilan kustom disimpan dalam teks biasa di penyimpanan lokal browser dan dikirim ke penyedia LLM yang Anda konfigurasi sebagai bagian dari prompt sistem. Alat keterampilan yang diimpor dapat mengirim input yang dideklarasikan ke endpoint HTTPS yang dideklarasikan tanpa konfirmasi per panggilan; alat unduh tetap meminta melalui gerbang izin Unduhan normal sebelum menyimpan file. Hanya impor alat yang Anda percayai; konten jarak jauh disalin ke penyimpanan saat impor.',
diff --git a/src/firefox/src/ui/locales/ja.js b/src/firefox/src/ui/locales/ja.js
index d0e470c69..8005a9a9b 100644
--- a/src/firefox/src/ui/locales/ja.js
+++ b/src/firefox/src/ui/locales/ja.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} 文字',
'st.skills.item.tools': 'ツール: {tools}',
'st.skills.remove': '削除',
+ 'st.skills.edit': '編集',
'st.skills.preview.rendered': 'プレビュー',
'st.skills.preview.raw': 'ソース',
'st.skills.security_html': '<strong>注意:</strong> カスタムスキルはブラウザのローカルストレージに平文で保存され、システムプロンプトの一部として設定済みのLLMプロバイダーに送信されます。インポートされたスキルツールは、宣言された入力を宣言されたHTTPSエンドポイントに呼び出しごとの確認なしで送信できます。ダウンロードツールはファイル保存前に通常のダウンロード許可ゲートを通じて確認します。信頼するツールのみをインポートしてください。リモートコンテンツはインポート時にストレージにコピーされます。',
diff --git a/src/firefox/src/ui/locales/ko.js b/src/firefox/src/ui/locales/ko.js
index 9fdc8e453..c76af14de 100644
--- a/src/firefox/src/ui/locales/ko.js
+++ b/src/firefox/src/ui/locales/ko.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count}자',
'st.skills.item.tools': '도구: {tools}',
'st.skills.remove': '제거',
+ 'st.skills.edit': '수정',
'st.skills.preview.rendered': '미리보기',
'st.skills.preview.raw': '원문',
'st.skills.security_html': '<strong>알림:</strong> 사용자 정의 스킬은 브라우저 로컬 스토리지에 일반 텍스트로 저장되며 시스템 프롬프트의 일부로 구성된 LLM 제공업체에 전송됩니다. 가져온 스킬 도구는 호출별 확인 없이 선언된 입력을 선언된 HTTPS 엔드포인트로 보낼 수 있습니다. 다운로드 도구는 파일 저장 전에 일반 다운로드 권한 게이트를 통해 계속 확인합니다. 신뢰하는 도구만 가져오세요. 원격 콘텐츠는 가져올 때 스토리지에 복사됩니다.',
diff --git a/src/firefox/src/ui/locales/ms.js b/src/firefox/src/ui/locales/ms.js
index 6e11c252b..23c374fda 100644
--- a/src/firefox/src/ui/locales/ms.js
+++ b/src/firefox/src/ui/locales/ms.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} aksara',
'st.skills.item.tools': 'Alatan: {tools}',
'st.skills.remove': 'Alih keluar',
+ 'st.skills.edit': 'Edit',
'st.skills.preview.rendered': 'Pratonton',
'st.skills.preview.raw': 'Mentah',
'st.skills.security_html': '<strong>Awas:</strong> kemahiran tersuai disimpan dalam teks biasa dalam storan tempatan pelayar dan dihantar kepada pembekal LLM yang anda konfigurasikan sebagai sebahagian daripada prompt sistem. Alatan kemahiran yang diimport boleh menghantar input yang diisytiharkan ke titik akhir HTTPS yang diisytiharkan tanpa pengesahan setiap panggilan; alatan muat turun masih meminta melalui gerbang kebenaran Muat Turun biasa sebelum menyimpan fail. Hanya import alatan yang anda percayai; kandungan jauh disalin ke storan semasa import.',
diff --git a/src/firefox/src/ui/locales/nl.js b/src/firefox/src/ui/locales/nl.js
index a3f16e97a..f93c765a8 100644
--- a/src/firefox/src/ui/locales/nl.js
+++ b/src/firefox/src/ui/locales/nl.js
@@ -678,6 +678,7 @@ export default {
'st.skills.item.chars': '{count} tekens',
'st.skills.item.tools': 'Tools: {tools}',
'st.skills.remove': 'Verwijderen',
+ 'st.skills.edit': 'Bewerken',
'st.skills.preview.rendered': 'Voorbeeld',
'st.skills.preview.raw': 'Ruw',
'st.skills.security_html': '<strong>Let op:</strong> aangepaste vaardigheden worden in platte tekst opgeslagen...',
diff --git a/src/firefox/src/ui/locales/pl.js b/src/firefox/src/ui/locales/pl.js
index 4e45f0b16..71c3aae77 100644
--- a/src/firefox/src/ui/locales/pl.js
+++ b/src/firefox/src/ui/locales/pl.js
@@ -693,6 +693,7 @@ export default {
'st.skills.item.chars': '{count} znaków',
'st.skills.item.tools': 'Narzędzia: {tools}',
'st.skills.remove': 'Usuń',
+ 'st.skills.edit': 'Edytuj',
'st.skills.preview.rendered': 'Podgląd',
'st.skills.preview.raw': 'Surowy tekst',
'st.skills.security_html': '<strong>Uwaga:</strong> niestandardowe umiejętności są przechowywane w postaci zwykłego tekstu w lokalnym magazynie przeglądarki i wysyłane do skonfigurowanego dostawcy LLM jako część promptu systemowego. Zaimportowane narzędzia umiejętności mogą wysyłać swoje zadeklarowane dane wejściowe do zadeklarowanych punktów końcowych HTTPS bez potwierdzenia na każde wywołanie; narzędzia do pobierania nadal pytają przez normalną bramę uprawnień Pobierania przed zapisaniem plików. Importuj tylko narzędzia, którym ufasz; zdalna treść jest kopiowana do magazynu podczas importu.',
diff --git a/src/firefox/src/ui/locales/pt.js b/src/firefox/src/ui/locales/pt.js
index 7dbfe6ad9..045622a2b 100644
--- a/src/firefox/src/ui/locales/pt.js
+++ b/src/firefox/src/ui/locales/pt.js
@@ -744,6 +744,7 @@ export default {
'st.skills.item.chars': "Caracteres {count}",
'st.skills.item.tools': "Ferramentas: {tools}",
'st.skills.remove': "Remover",
+ 'st.skills.edit': 'Editar',
'st.skills.cws.heading': "Configuração de versão Chrome Web Store",
'st.skills.cws.desc_html': "Essas configurações aparecem apenas enquanto a habilidade de liberação do pacote está habilitada. Crie um Google Cloud OAuth <strong>Aplicativo web</strong>, ative a API Chrome Web Store e registre-se <code>http://localhost:1457/auth/callback</code> como um URI de redirecionamento autorizado. Credenciais, tokens e bytes ZIP permanecem no armazenamento local de extensão e nunca são incluídos em prompts ou rastreamentos de modelo.",
'st.skills.cws.publisher_id': "ID do editor",
diff --git a/src/firefox/src/ui/locales/ru.js b/src/firefox/src/ui/locales/ru.js
index 1e1e9cb06..081095257 100644
--- a/src/firefox/src/ui/locales/ru.js
+++ b/src/firefox/src/ui/locales/ru.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} символов',
'st.skills.item.tools': 'Инструменты: {tools}',
'st.skills.remove': 'Удалить',
+ 'st.skills.edit': 'Редактировать',
'st.skills.preview.rendered': 'Предпросмотр',
'st.skills.preview.raw': 'Исходник',
'st.skills.security_html': '<strong>Внимание:</strong> пользовательские навыки хранятся в открытом тексте в локальном хранилище браузера и отправляются вашему настроенному LLM-провайдеру как часть системного промпта. Импортированные инструменты навыков могут отправлять свои объявленные входные данные на свои объявленные HTTPS-эндоинты без подтверждения каждого вызова; инструменты загрузки всё равно запрашивают разрешение через обычный шлюз разрешений Загрузок перед сохранением файлов. Импортируйте только те инструменты, которым вы доверяете; удалённое содержимое копируется в хранилище при импорте.',
diff --git a/src/firefox/src/ui/locales/th.js b/src/firefox/src/ui/locales/th.js
index a90a28319..fd8a79f9c 100644
--- a/src/firefox/src/ui/locales/th.js
+++ b/src/firefox/src/ui/locales/th.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} ตัวอักษร',
'st.skills.item.tools': 'เครื่องมือ: {tools}',
'st.skills.remove': 'ลบ',
+ 'st.skills.edit': 'แก้ไข',
'st.skills.preview.rendered': 'ตัวอย่าง',
'st.skills.preview.raw': 'ต้นฉบับ',
'st.skills.security_html': '<strong>ข้อควรระวัง:</strong> ทักษะที่กำหนดเองจะถูกเก็บเป็นข้อความธรรมดาในพื้นที่จัดเก็บของเบราว์เซอร์และส่งไปยังผู้ให้บริการ LLM ที่คุณกำหนดค่าไว้เป็นส่วนหนึ่งของระบบพรอมพ์ เครื่องมือทักษะที่นำเข้าสามารถส่งอินพุตที่ประกาศไปยังปลายทาง HTTPS ที่ประกาศไว้โดยไม่ต้องยืนยันทุกครั้ง เครื่องมือดาวน์โหลดยังคงขอผ่านประตูอนุญาตการดาวน์โหลดปกติก่อนบันทึกไฟล์ นำเข้าเฉพาะเครื่องมือที่คุณเชื่อถือ เนื้อหาระยะไกลจะถูกคัดลอกไปยังพื้นที่จัดเก็บเมื่อนำเข้า',
diff --git a/src/firefox/src/ui/locales/tl.js b/src/firefox/src/ui/locales/tl.js
index 20eccbc92..698be8458 100644
--- a/src/firefox/src/ui/locales/tl.js
+++ b/src/firefox/src/ui/locales/tl.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} karakter',
'st.skills.item.tools': 'Mga tool: {tools}',
'st.skills.remove': 'Alisin',
+ 'st.skills.edit': 'I-edit',
'st.skills.preview.rendered': 'Paunang tingin',
'st.skills.preview.raw': 'Hilaw',
'st.skills.security_html': '<strong>Paalala:</strong> ang mga custom na kasanayan ay naka-store bilang plaintext sa browser local storage at ipinapadala sa iyong na-configure na LLM provider bilang bahagi ng system prompt. Ang mga na-import na tool ng kasanayan ay maaaring magpadala ng kanilang mga declared input sa kanilang declared HTTPS endpoint nang walang per-call confirmation; ang mga download tool ay humihingi pa rin sa pamamagitan ng normal na Downloads permission gate bago mag-save ng mga file. Ang mga tool lang na pinagkakatiwalaan mo ang i-import; ang remote na content ay kinokopya sa storage sa oras ng pag-import.',
diff --git a/src/firefox/src/ui/locales/tr.js b/src/firefox/src/ui/locales/tr.js
index e57214aec..158c82b0c 100644
--- a/src/firefox/src/ui/locales/tr.js
+++ b/src/firefox/src/ui/locales/tr.js
@@ -86,6 +86,7 @@ export default {
'st.skills.item.chars': '{count} karakter',
'st.skills.item.tools': 'Tool\'lar: {tools}',
'st.skills.remove': 'Kaldır',
+ 'st.skills.edit': 'Düzenle',
'st.skills.preview.rendered': 'Önizleme',
'st.skills.preview.raw': 'Ham',
'st.skills.security_html': '<strong>Dikkat:</strong> özel skill\'ler tarayıcı yerel depolamasında düz metin olarak saklanır. Mid/Full katmanlarında uygun adlar ve özetler küçük bir yükleyici kataloğu olarak yapılandırdığın LLM sağlayıcısına gönderilir; tam talimatlar yalnızca skill o çalışma için yüklendikten sonra gönderilir. İçe aktarılan skill tool\'ları daha sonra, çağrı başına tekrar onay istemeden beyan edilen girdileri beyan edilen HTTPS endpoint\'lerine gönderebilir; download tool\'ları dosya kaydetmeden önce normal Downloads izin akışını kullanır. Yalnızca güvendiğin tool\'ları içe aktar; uzak içerik içe aktarma sırasında depoya kopyalanır.',
diff --git a/src/firefox/src/ui/locales/uk.js b/src/firefox/src/ui/locales/uk.js
index 325dbeb3d..b71bea147 100644
--- a/src/firefox/src/ui/locales/uk.js
+++ b/src/firefox/src/ui/locales/uk.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} символів',
'st.skills.item.tools': 'Інструменти: {tools}',
'st.skills.remove': 'Видалити',
+ 'st.skills.edit': 'Редагувати',
'st.skills.preview.rendered': 'Перегляд',
'st.skills.preview.raw': 'Оригінал',
'st.skills.security_html': '<strong>Увага:</strong> власні навички зберігаються у відкритому тексті в локальному сховищі браузера та надсилаються вашому налаштованому LLM-провайдеру як частина системного промпту. Імпортовані інструменти навичок можуть надсилати свої оголошені вхідні дані на свої оголошені HTTPS-ендпоінти без підтвердження кожного виклику; інструменти завантаження все одно запитують через звичайний шлюз дозволів Завантажень перед збереженням файлів. Імпортуйте лише ті інструменти, яким ви довіряєте; віддалений вміст копіюється в сховище під час імпорту.',
diff --git a/src/firefox/src/ui/locales/vi.js b/src/firefox/src/ui/locales/vi.js
index 455be9310..b6db304f8 100644
--- a/src/firefox/src/ui/locales/vi.js
+++ b/src/firefox/src/ui/locales/vi.js
@@ -744,6 +744,7 @@ export default {
'st.skills.item.chars': "Ký tự {count}",
'st.skills.item.tools': "Dụng cụ: {tools}",
'st.skills.remove': "Xóa",
+ 'st.skills.edit': 'Chỉnh sửa',
'st.skills.cws.heading': "Thiết lập phát hành Chrome Web Store",
'st.skills.cws.desc_html': "Các cài đặt này chỉ xuất hiện khi kỹ năng phát hành đóng gói được bật. Tạo OAuth trên đám mây của Google <strong>Ứng dụng web</strong>, kích hoạt API Chrome Web Store và đăng ký <code>http://localhost:1457/auth/callback</code> dưới dạng URI chuyển hướng được ủy quyền. Thông tin xác thực, mã thông báo và byte ZIP vẫn nằm trong bộ nhớ cục bộ của tiện ích mở rộng và không bao giờ được đưa vào lời nhắc hoặc dấu vết mô hình.",
'st.skills.cws.publisher_id': "Mã nhà xuất bản",
diff --git a/src/firefox/src/ui/locales/zh.js b/src/firefox/src/ui/locales/zh.js
index 94670d70c..d92eadebb 100644
--- a/src/firefox/src/ui/locales/zh.js
+++ b/src/firefox/src/ui/locales/zh.js
@@ -702,6 +702,7 @@ export default {
'st.skills.item.chars': '{count} 个字符',
'st.skills.item.tools': '工具:{tools}',
'st.skills.remove': '移除',
+ 'st.skills.edit': '编辑',
'st.skills.preview.rendered': '预览',
'st.skills.preview.raw': '原始文本',
'st.skills.security_html': '<strong>注意:</strong>自定义技能以纯文本形式存储在浏览器本地存储中,并作为系统提示的一部分发送给您配置的 LLM 提供商。导入的技能工具可以在没有每次调用确认的情况下将其声明的输入发送到其声明的 HTTPS 端点;下载工具在保存文件之前仍会通过正常的下载权限门询问。只导入您信任的工具;远程内容在导入时会被复制到存储中。',
diff --git a/src/firefox/src/ui/settings.js b/src/firefox/src/ui/settings.js
index 4eb24edbb..d1da1d95d 100644
--- a/src/firefox/src/ui/settings.js
+++ b/src/firefox/src/ui/settings.js
@@ -510,6 +510,7 @@ function boundedMaxAgentSteps(value) {
let providerFilter = 'all'; // 'all' | 'active' | 'local' | 'cloud' | 'router'
let providerSearchQuery = '';
const expandedProviders = new Set();
+let editingSkillId = null;
let customSkills = [];
let skillPreviewRequestId = 0;
const DEFAULT_SKILL_IDS = new Set(DEFAULT_SKILL_SOURCES.map((source) => source.id));
@@ -639,7 +640,7 @@ async function init() {
if (costSessionLimitInput) costSessionLimitInput.value = sessionLimit.toFixed(2);
if (costTotalLimitInput) costTotalLimitInput.value = totalLimit.toFixed(2);
renderCostAllowanceSpent(totalSpent, totalLimit);
- if (strictSecretToggle) strictSecretToggle.checked = stored.strictSecretMode === true; // off by default
+ if (strictSecretToggle) strictSecretToggle.checked = stored.strictSecretMode !== false; // on by default
if (allowLocalNetworkToggle) allowLocalNetworkToggle.checked = stored.agentAllowLocalNetwork === true;
if (scheduledTasksToggle) scheduledTasksToggle.checked = stored.scheduledTasksEnabled !== false;
if (scheduledConfirmToggle) scheduledConfirmToggle.checked = stored.scheduledRequireConsequentialConfirmation !== false;
@@ -986,6 +987,7 @@ function renderSkills() {
data-skill-preview-id="${escapeHtml(skill.id)}">${escapeHtml(skill.name)}</button>
<div class="setting-desc skill-source">${escapeHtml(source)} · ${escapeHtml(t('st.skills.item.chars', { count: skill.content.length }))}${escapeHtml(toolSummary)}</div>
</div>
+ <button class="btn-secondary" data-skill-edit-id="${escapeHtml(skill.id)}">${escapeHtml(t('st.skills.edit'))}</button>
<button class="btn-secondary" data-skill-id="${escapeHtml(skill.id)}">${escapeHtml(t('st.skills.remove'))}</button>
</div>`;
}).join('');
@@ -993,8 +995,17 @@ function renderSkills() {
skillsList.querySelectorAll('button[data-skill-preview-id]').forEach((btn) => {
btn.addEventListener('click', () => previewEnabledSkill(btn.dataset.skillPreviewId));
});
+ skillsList.querySelectorAll('button[data-skill-edit-id]').forEach((btn) => {
+ btn.addEventListener('click', () => {
+ const skill = customSkills.find((s) => s.id === btn.dataset.skillEditId);
+ if (skill) startSkillEdit(skill);
+ });
+ });
skillsList.querySelectorAll('button[data-skill-id]').forEach((btn) => {
btn.addEventListener('click', async () => {
+ if (editingSkillId === btn.dataset.skillId) {
+ cancelSkillEdit();
+ }
const removedSkill = customSkills.find((skill) => skill.id === btn.dataset.skillId);
await saveCustomSkills(
customSkills.filter((skill) => skill.id !== btn.dataset.skillId),
@@ -1037,6 +1048,24 @@ async function addPackagedSkill(skillId, button) {
}
}
+function startSkillEdit(skill) {
+ editingSkillId = skill.id;
+ if (skillNameInput) skillNameInput.value = skill.name || '';
+ if (skillTextArea) skillTextArea.value = skill.content || '';
+ if (btnAddSkillText) btnAddSkillText.textContent = t('st.providers.save');
+ flashSkillsResult('ok', skill.name || t('st.skills.edit'));
+ skillNameInput?.focus?.();
+ if (skillTextArea) skillTextArea.scrollIntoView({ behavior: 'smooth', block: 'center' });
+}
+
+function cancelSkillEdit() {
+ if (editingSkillId == null) return;
+ editingSkillId = null;
+ if (btnAddSkillText) btnAddSkillText.textContent = t('st.skills.add_text');
+ if (skillNameInput) skillNameInput.value = '';
+ if (skillTextArea) skillTextArea.value = '';
+}
+
async function addSkillFromText() {
const content = (skillTextArea?.value || '').trim();
if (!content) {
@@ -1044,6 +1073,23 @@ async function addSkillFromText() {
return;
}
try {
+ if (editingSkillId) {
+ const original = customSkills.find((s) => s.id === editingSkillId);
+ if (!original) {
+ cancelSkillEdit();
+ throw new Error(t('st.skills.error.add_failed'));
+ }
+ const updated = {
+ ...original,
+ name: (skillNameInput?.value || '').trim() || original.name || '',
+ content,
+ };
+ const next = customSkills.map((s) => (s.id === editingSkillId ? updated : s));
+ await saveCustomSkills(next);
+ cancelSkillEdit();
+ flashSkillsResult('ok', t('st.providers.saved'));
+ return;
+ }
await addCustomSkill({
id: makeSkillId(),
name: skillNameInput?.value || '',
@@ -1113,6 +1159,7 @@ async function addSkillFromUrl() {
btnAddSkillText?.addEventListener('click', addSkillFromText);
btnAddSkillUrl?.addEventListener('click', addSkillFromUrl);
btnClearSkillForm?.addEventListener('click', () => {
+ cancelSkillEdit();
if (skillNameInput) skillNameInput.value = '';
if (skillUrlInput) skillUrlInput.value = '';
if (skillTextArea) skillTextArea.value = '';
diff --git a/test/README.md b/test/README.md
index 4a4326622..4494669a3 100644
--- a/test/README.md
+++ b/test/README.md
@@ -151,3 +151,10 @@ python3 -m http.server 8765 -d test/memory
Then open `http://127.0.0.1:8765/`. The page walks through `/memory --add`,
form-derived learning, normal auto-learning, replaying saved memories into a
later form, and Profile auto-fill.
+
+### Native browser dialogs
+
+`node --test test/browser-dialogs.mjs` covers dialog responses, per-tab ownership,
+Stop/abort, retained Dev sessions, and protocol races (included in `npm test`).
+`node test/browser-dialogs-e2e.mjs` uses installed Chrome through Playwright to
+verify real alert/confirm/prompt and beforeunload continuation.
diff --git a/test/browser-dialogs-e2e.mjs b/test/browser-dialogs-e2e.mjs
new file mode 100644
index 000000000..7d927eb02
--- /dev/null
+++ b/test/browser-dialogs-e2e.mjs
@@ -0,0 +1,50 @@
+import assert from 'node:assert/strict';
+import { chromium } from 'playwright';
+import { CDPClient } from '../src/chrome/src/cdp/cdp-client.js';
+
+const timeout = setTimeout(() => { console.error('Dialog test timed out'); process.exit(1); }, 30000);
+const browser = await chromium.launch({ channel: 'chrome', headless: true });
+try {
+ const page = await browser.newPage();
+ // Prevent Playwright's default dismissal: the production client must answer.
+ page.on('dialog', () => {});
+ const session = await page.context().newCDPSession(page);
+ const client = new CDPClient();
+ const answered = [];
+ client.attach = async () => {};
+ client.sendCommand = (_tab, method, params) => session.send(method, params);
+ session.on('Page.javascriptDialogOpening', params => client._onDebuggerEvent(
+ { tabId: 1 }, 'Page.javascriptDialogOpening', params,
+ ));
+ session.on('Page.javascriptDialogClosed', params => client._onDebuggerEvent(
+ { tabId: 1 }, 'Page.javascriptDialogClosed', params,
+ ));
+ await client.startDialogHandling(1, { onHandled: type => answered.push(type) });
+ await page.setContent('<button id="go">Continue</button>');
+ const result = await session.send('Runtime.evaluate', {
+ expression: `(() => { alert('Notice'); const confirmed = confirm('Continue?');
+ const answer = prompt('Value?', 'default value'); return { confirmed, answer }; })()`,
+ returnByValue: true,
+ });
+ assert.deepEqual(result.result.value, { confirmed: true, answer: 'default value' });
+ await page.evaluate(() => {
+ document.querySelector('#go').onclick = () => {
+ window.onbeforeunload = event => { event.preventDefault(); event.returnValue = ''; };
+ };
+ });
+ await page.click('#go');
+ await page.goto('about:blank');
+ assert.equal(page.url(), 'about:blank');
+ assert.deepEqual(answered, ['alert', 'confirm', 'prompt', 'beforeunload']);
+ client.stopDialogHandling(1);
+ const opened = new Promise(resolve => session.once('Page.javascriptDialogOpening', resolve));
+ const pending = session.send('Runtime.evaluate', { expression: 'confirm("Already open")', returnByValue: true });
+ await opened;
+ await client.startDialogHandling(1);
+ assert.equal((await pending).result.value, true);
+ client.stopDialogHandling(1);
+ console.log('PASS: real Chrome alert, confirm, prompt, and beforeunload resume renderer/navigation.');
+} finally {
+ await browser.close();
+ clearTimeout(timeout);
+}
diff --git a/test/browser-dialogs.mjs b/test/browser-dialogs.mjs
new file mode 100644
index 000000000..97c336041
--- /dev/null
+++ b/test/browser-dialogs.mjs
@@ -0,0 +1,180 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { CDPClient } from '../src/chrome/src/cdp/cdp-client.js';
+
+function harness() {
+ const calls = [];
+ const client = new CDPClient();
+ client.sessions.set(7, { tabId: 7 });
+ client.attach = async id => client.sessions.set(id, { tabId: id });
+ client.sendCommand = async (...args) => { calls.push(args); };
+ return { client, calls };
+}
+const tick = () => new Promise(resolve => setImmediate(resolve));
+
+test('native dialogs continue immediately, preserving prompt defaults and child sessions', async () => {
+ const { client, calls } = harness();
+ const handled = [];
+ await client.startDialogHandling(7, { onHandled: type => handled.push(type) });
+ assert.equal(calls[0][1], 'Page.enable');
+ for (const type of ['alert', 'confirm', 'beforeunload', 'prompt']) {
+ client._onDebuggerEvent({ tabId: 7, sessionId: 'child' }, 'Page.javascriptDialogOpening', {
+ type, defaultPrompt: 'existing answer', message: 'untrusted instructions',
+ });
+ }
+ await tick();
+ assert.deepEqual(handled, ['alert', 'confirm', 'beforeunload', 'prompt']);
+ assert.deepEqual(calls.slice(1), ['alert', 'confirm', 'beforeunload', 'prompt'].map(type => [
+ 7, 'Page.handleJavaScriptDialog',
+ type === 'prompt' ? { accept: true, promptText: 'existing answer' } : { accept: true }, 'child',
+ ]));
+});
+
+test('inactive tabs, stop, abort, and cleanup never auto-answer dialogs', async () => {
+ const { client, calls } = harness();
+ const emit = id => client._onDebuggerEvent({ tabId: id }, 'Page.javascriptDialogOpening', { type: 'confirm' });
+ emit(7);
+ client._onDebuggerEvent({ tabId: 7 }, 'Page.javascriptDialogClosed', {});
+ const controller = new AbortController();
+ await client.startDialogHandling(7, { signal: controller.signal });
+ emit(8);
+ controller.abort();
+ emit(7);
+ client._onDebuggerEvent({ tabId: 7 }, 'Page.javascriptDialogClosed', {});
+ await client.startDialogHandling(7);
+ client.stopDialogHandling(7);
+ emit(7);
+ client._onDebuggerEvent({ tabId: 7 }, 'Page.javascriptDialogClosed', {});
+ await client.startDialogHandling(7);
+ client.devDiagnostics.set(7, {}); // debugger survives the run
+ client.disableWebMCP = async () => {};
+ await client.cleanupRun(7);
+ emit(7);
+ client._onDebuggerEvent({ tabId: 7 }, 'Page.javascriptDialogClosed', {});
+ await tick();
+ assert.ok(calls.every(call => call[1] === 'Page.enable'));
+});
+
+test('failed startup and already-aborted runs do not retain dialog handling', async () => {
+ const { client } = harness();
+ await client.startDialogHandling(7, { signal: AbortSignal.abort() });
+ assert.equal(client.dialogRuns.size, 0);
+ client.sendCommand = async () => { throw new Error('detached'); };
+ await assert.rejects(client.startDialogHandling(7));
+ assert.equal(client.dialogRuns.size, 0);
+});
+
+test('dialog races consume protocol failures without retrying the next dialog', async () => {
+ const { client, calls } = harness();
+ await client.startDialogHandling(7);
+ client.sendCommand = async (...args) => { calls.push(args); throw new Error('No dialog'); };
+ client._onDebuggerEvent({ tabId: 7 }, 'Page.javascriptDialogOpening', { type: 'alert' });
+ await tick();
+ assert.equal(calls.length, 2);
+});
+
+test('a new action run resumes an already-observed dialog exactly once', async () => {
+ const { client, calls } = harness();
+ client._onDebuggerEvent({ tabId: 7 }, 'Page.javascriptDialogOpening', { type: 'beforeunload' });
+ assert.equal(calls.length, 0);
+ await client.startDialogHandling(7);
+ await client.startDialogHandling(7);
+ assert.equal(calls.filter(call => call[1] === 'Page.handleJavaScriptDialog').length, 1);
+ client._onDebuggerEvent({ tabId: 7 }, 'Page.javascriptDialogClosed', {});
+ assert.equal(client.pendingDialogs.size, 0);
+});
+
+test('cached dialog is answered before renderer-dependent Page.enable', async () => {
+ const { client } = harness();
+ client._onDebuggerEvent({ tabId: 7 }, 'Page.javascriptDialogOpening', { type: 'alert' });
+ let answered = false;
+ client.sendCommand = async (_tabId, method) => {
+ if (method === 'Page.handleJavaScriptDialog') answered = true;
+ if (method === 'Page.enable') assert.equal(answered, true);
+ };
+ await client.startDialogHandling(7);
+});
+
+for (const action of ['abort', 'stop', 'timeout']) {
+ test(`${action} releases blocked Page.enable startup`, async () => {
+ const { client } = harness();
+ const controller = new AbortController();
+ let entered;
+ const ready = new Promise(resolve => { entered = resolve; });
+ let finish;
+ client.sendCommand = () => { entered(); return new Promise(resolve => { finish = resolve; }); };
+ const startup = client.startDialogHandling(7, { signal: controller.signal, timeoutMs: 20 });
+ const rejected = assert.rejects(startup, error => action === 'timeout'
+ ? error.code === 'dialog_startup_timeout' : error.name === 'AbortError');
+ await ready;
+ if (action === 'abort') controller.abort();
+ if (action === 'stop') client.stopDialogHandling(7);
+ await rejected;
+ assert.equal(client.dialogRuns.has(7), false);
+ finish();
+ await tick();
+ assert.equal(client.dialogRuns.has(7), false);
+ });
+}
+
+test('failed workflow setup releases its debugger but preserves a Dev owner', async () => {
+ const previousChrome = globalThis.chrome;
+ const area = { get: async () => ({}), set: async () => {}, remove: async () => {} };
+ let detaches = 0;
+ globalThis.chrome = {
+ storage: { local: area, session: area },
+ runtime: { getURL: value => value },
+ tabs: { get: async id => ({ id, url: 'https://example.com/' }) },
+ debugger: { detach: (_target, callback) => { detaches++; callback(); } },
+ };
+ const { Agent } = await import('../src/chrome/src/agent/agent.js');
+ const { cdpClient } = await import('../src/chrome/src/cdp/cdp-client.js');
+ const originalAttach = cdpClient.attach;
+ const originalSend = cdpClient.sendCommand;
+ try {
+ cdpClient.attach = async id => cdpClient.sessions.set(id, { tabId: id });
+ cdpClient.sendCommand = async () => ({});
+ for (const preserveDev of [false, true]) {
+ const tabId = preserveDev ? 92 : 91;
+ const agent = new Agent({ getActive: () => ({ promptTier: 'full' }) });
+ agent._hydrate = async () => {};
+ agent._currentUrl = async () => { throw new Error('workflow setup failure'); };
+ if (preserveDev) cdpClient.devDiagnostics.set(tabId, {});
+ await assert.rejects(agent.replaySavedWorkflow(tabId, { id: 'test', steps: [{}] }), /workflow setup failure/);
+ assert.equal(agent.isRunning(tabId), false);
+ assert.equal(cdpClient.dialogRuns.has(tabId), false);
+ assert.equal(cdpClient.sessions.has(tabId), preserveDev);
+ assert.equal(cdpClient.devDiagnostics.has(tabId), preserveDev);
+ cdpClient.devDiagnostics.delete(tabId);
+ cdpClient.sessions.delete(tabId);
+ }
+ assert.equal(detaches, 1);
+ for (const streaming of [false, true]) {
+ const tabId = streaming ? 94 : 93;
+ const agent = new Agent({ getActive: () => ({ promptTier: 'full' }) });
+ agent._hydrate = async () => {};
+ agent._persistNow = async () => ({});
+ agent._beginReadCompleteness = async () => '';
+ let entered;
+ const ready = new Promise(resolve => { entered = resolve; });
+ cdpClient.sendCommand = async (_id, method) => {
+ if (method === 'Page.enable') { entered(); return new Promise(() => {}); }
+ return {};
+ };
+ const run = streaming
+ ? agent.processMessageStream(tabId, 'Continue', () => {}, 'act')
+ : agent.processMessage(tabId, 'Continue', () => {}, 'act');
+ await ready;
+ agent.abort(tabId);
+ assert.match(await run, /Stopped by user/);
+ assert.equal(agent.isRunning(tabId), false);
+ assert.equal(cdpClient.sessions.has(tabId), false);
+ assert.equal(cdpClient.dialogRuns.has(tabId), false);
+ }
+
+ } finally {
+ cdpClient.attach = originalAttach;
+ cdpClient.sendCommand = originalSend;
+ globalThis.chrome = previousChrome;
+ }
+});