Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ExecuteScript and CallDevToolsProtocolMethod never complete when the result contains an unpaired UTF-16 surrogate

Aperta
#5,784 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
powershell

Direzione di ricerca

Start by reproducing the issue in a WebView2 control with the supplied HTML, then compare ExecuteScript and CallDevToolsProtocolMethod with the remote-debugging websocket responses. The report identifies the affected host APIs but names no implementation files or tests, so locating the bridge code will require project familiarity. Done means both calls invoke their completion handlers for results containing an unpaired surrogate, or return a failing HRESULT.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

WebView2 Runtime 155.0.4283.45 (Windows 11), host via webview2-com 0.39.1.

A page whose text holds an unpaired surrogate — e.g. a script that slices a string in the middle of an emoji,
"🐢 name".slice(1) — makes host-side calls on that page never complete:

call (host API) text without the half emoji with it
ExecuteScript("(() => document.body.innerText)()") completes completion handler never invoked (10 s)
CallDevToolsProtocolMethod("Accessibility.getFullAXTree", "{}") completes completion handler never invoked (5 s)

The same tab queried over the remote-debugging websocket (CDP Runtime.evaluate with returnByValue, and
Accessibility.getFullAXTree) answers normally: the string comes back with a \udc22 escape and the AX tree has its
nodes. So the content is serializable; only the host bridge drops it.

Repro:

<!doctype html><p id=n></p><button>Post</button>
<script>document.getElementById('n').textContent = "🐢 quiet turtle".slice(1) + " · " + "🐢".slice(0, 1);</script>

Load it in a WebView2 control, then call ExecuteScript("document.body.innerText") or
CallDevToolsProtocolMethod("Accessibility.getFullAXTree", "{}") and wait for the completion handler.

Expected: the handler is invoked — with the JSON carrying the lone surrogate as an escape (as JSON.stringify and CDP
over the websocket do) or replaced by U+FFFD — or with a failing HRESULT. Today it is never invoked, so a host cannot
tell "no answer" from "slow".

Note: for ExecuteScript a script can pass its result through String.prototype.toWellFormed() first; for
CallDevToolsProtocolMethod the text is the page's own, so there is nothing to wrap.

Lingua principale
PowerShell
Stelle
526
Fork
68
Merge medio
15g 5h
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MicrosoftEdge/WebView2Feedback

Tutte le issue di MicrosoftEdge/WebView2Feedback

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.