browser_handle_dialog without action answers "Leave site?" with Leave - unsaved input is lost, unlike browser_navigate's safe Stay
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 63/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- developer-experience
Direzione di ricerca
Start by reading the browser_handle_dialog implementation and its tool description, then compare its default action with browser_navigate’s handling of beforeunload dialogs. Reproduce with the supplied local page and check both beforeunload and confirm behavior. Done when an omitted action no longer accepts a destructive dialog by default, with tests covering the chosen behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version: 1.30.3 (Windows 11, Chrome stable). Same code on feat/1.32-partitioner (const action = params.action === 'dismiss' ? 'dismiss' : 'accept').
What happens. browser_navigate (since #69) answers "Leave site?" with Stay and asks the agent to get the user's consent before leave_page: true. browser_handle_dialog has the opposite default: with no action it accepts every dialog type, and for beforeunload accept means Leave. So the one tool an agent is told to use when "a dialog is open" silently throws away the user's unsaved work if the agent leaves out action. An armed handle_dialog without action also overrides navigate's Stay.
Repro (local page).
<input id="inp">
<label><input type="checkbox" id="bu"> arm "Leave site?"</label>
<a id="leave" href="other.html">Leave this page</a>
<script>
addEventListener('beforeunload', e => { if (bu.checked) { e.preventDefault(); e.returnValue = ''; } });
</script>
browser_click('#bu'),browser_fill('#inp', 'UNSAVED DRAFT TEXT').browser_click('#leave')->ok:false, "the input opened a dialog ... see browser_handle_dialog" (fine).browser_handle_dialog()(noaction) ->{"ok":true,"dialog_type":"beforeunload","action":"accept","note":"The page was left. ..."}- the draft is gone.
The answer is honest, but the default is destructive, and it is the opposite of what browser_navigate does in the same situation. A confirm() handled the same way is also accepted by default (e.g. "Delete this item?").
Expected / suggestion. For beforeunload (and ideally for confirm), make the default dismiss (Stay / Cancel), or require an explicit action and answer an error without it - matching browser_navigate's leave_page consent model. The tool description could then say "Leave only with action: accept, after the user agreed".
- Lingua principale
- JavaScript
- Stelle
- 52
- Fork
- 17
- Merge medio
- 4g 2h
- PR unite (30g)
- 13
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Agent360dk/browser-mcp
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
Agent360dk/browser-mcp#124 ·
I maintainer di solito rispondono entro 2 giorni
-
Add official-registry and directory badges to the READMEForse già presa @avaldivieso-meraki l’ha presa oggi. Apertadocumentation good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
Agent360dk/browser-mcp#125 ·
I maintainer di solito rispondono entro 2 giorni
-
documentation good first issue
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
Agent360dk/browser-mcp#123 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
Agent360dk/browser-mcp#106 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
Agent360dk/browser-mcp#100 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di Agent360dk/browser-mcp
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
directus/directus#28558 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
cloudflare/workers-sdk#17189 ·
I maintainer di solito rispondono entro 1 giorno
-
AWS Lambda Waiting for: Product Owner
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
getsentry/sentry-javascript#26910 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[🐛 Bug]: @wdio/reporter drops the function name of a string script in command outputForse già presa @dhananjay6561 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
webdriverio/webdriverio#16507 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno