debug: habilita DevTools e captura erros JS no Photino

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ricardo Carneiro 2026-05-15 15:39:06 -03:00
parent 724983e96c
commit ad5312ba10
3 changed files with 15 additions and 2 deletions

View File

@ -11,7 +11,8 @@
"Bash(taskkill:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(xargs ls:*)"
"Bash(xargs ls:*)",
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\); [print\\(e['Route']\\) for e in d.get\\('Endpoints',[]\\)[:20]]\")"
]
}
}

View File

@ -26,6 +26,7 @@ class Program
app.MainWindow
.SetTitle("VideoStudy")
.SetSize(1280, 800)
.SetDevToolsEnabled(true)
.Center();
app.Run();

View File

@ -24,7 +24,18 @@
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="_framework/blazor.modules.js" type="module"></script>
<script>
window.onerror = function(msg, url, line, col, error) {
document.getElementById('app').innerHTML =
'<div style="color:red;padding:2rem;font-family:monospace;">' +
'<b>Erro JS:</b><br>' + msg + '<br>' + url + ':' + line + '</div>';
};
window.addEventListener('unhandledrejection', function(e) {
document.getElementById('app').innerHTML =
'<div style="color:red;padding:2rem;font-family:monospace;">' +
'<b>Promise rejeitada:</b><br>' + (e.reason?.message || e.reason) + '</div>';
});
</script>
<script src="_framework/blazor.photino.js"></script>
</body>
</html>