Revisione: il browser che non risponde nemmeno alla navigazione viene comunque in primo piano (#67)
Con la correzione #67 un browser che resta muto per tutta l'attesa conta come a riposo, e Febe prova ad aprire la pagina iniziale. Un browser che si sta ancora riavviando dopo «Scollega» rifiuta però anche Page.navigate: l'errore risaliva fino all'API e Alberto vedeva, dopo dieci secondi, un errore interno al posto della finestra. Ora quella navigazione mancata si annota nel registro («non aperta (il browser non risponde)») e la finestra viene in primo piano come prima. Nuova prova con un browser che non risponde a nulla, per «Usa il browser» e «Apri il browser». Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8edb706e06
commit
8d1b344366
3 files changed
+56
-1
No files matched your search
@@ -1136,7 +1136,19 @@ public sealed class BrowserConnectionService : IConnectionService, IAsyncDisposa
|
||||
return;
|
||||
}
|
||||
|
||||
var result = await _browser.Cdp.NavigateAsync(target, ct).ConfigureAwait(false);
|
||||
// A browser still silent (restarting after «Scollega», issue #67) usually refuses the navigation too: the window
|
||||
// comes to the front all the same, as when its page was unknown before, never an internal error.
|
||||
NavigationResult result;
|
||||
try
|
||||
{
|
||||
result = await _browser.Cdp.NavigateAsync(target, ct).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex) when (ex is CdpDisconnectedException or BrowserUnavailableException or CdpCommandException or TimeoutException)
|
||||
{
|
||||
_log.Info("collegamento", $"Alberto usa il browser: {what} non aperta (il browser non risponde).");
|
||||
return;
|
||||
}
|
||||
|
||||
_log.Info("collegamento", result.Succeeded
|
||||
? $"Alberto usa il browser: {what} aperta."
|
||||
: $"Alberto usa il browser: {what} non aperta (errore di rete del browser).");
|
||||
|
||||
Reference in new issue
Block a user