microsoft / vscode-js-debug

A DAP-compatible JavaScript debugger. Used in VS Code, VS, + more
MIT License
1.67k stars 282 forks source link

[CDP] Send telemetry for DotnetDebugger error event #1961

Closed mdh1418 closed 8 months ago

mdh1418 commented 8 months ago

When debugging blazorwasm applications using the BlazorDebugProxy, there are instances where the debugger itself hits an exception, such as attempting to evaluate an expression in the watch window when the debugger is paused. To capture how often users encounter such debugger exceptions, it would be helpful to send telemetry information for such events.

This PR looks to add a DotnetDebugger event listener to the Chrome DevTools Protocol (CDP) API, which upon hitting the event, the DapTelemetryReporter will send a telemetry report with an event name `blazor-debug/blazorDebugError'.

This PR does the following:

Associated PR in dotnet/runtime: https://github.com/dotnet/runtime/pull/99254

Testing

Built this repo locally Built the runtime repo locally with changes in https://github.com/dotnet/runtime/pull/99254/files via ./build.sh -s mono+libs -os browser after having relevant dependencies installed Created a new blazorwasm app with dotnet new blazorwasm Added a target in blazorwasm app's csproj to replace runtime pack with locally built one

  <Target Name="UpdateRuntimePack" AfterTargets="ResolveFrameworkReferences">
    <ItemGroup>
      <ResolvedRuntimePack PackageDirectory="/Users/mitchellhwang/projects/runtime/artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Debug" Condition="'%(ResolvedRuntimePack.FrameworkName)' == 'Microsoft.NETCore.App'" />
    </ItemGroup>
  </Target>

Replaced the nuget package microsoft.aspnetcore.components.webassembly.devserver/<version>/tools/BlazorDebugProxy with locally built BrowserDebugHost artifact folder. Ran the vscode-js-debug Extension configuration Opened blazorwasm app with the new vscode window Ran the blazorwasm app debugging Added a breakpoint in Counter Connected with BlazorDebugProxy Navigated the blazorwasm app to the Counter page Hit the set breakpoint Added an expression in the watch window such as Math.PI Checked telemetry database for the event.

Shygeek64 commented 3 months ago

J'ai besoin d'une aide secourable pour déboguer toutes mes pages web de vulnérabilités afin de passer au plan b: corriger mes vulnérabilités, j'en ai presque un millier depuis un bout de temps, voilà à quoi ressemble rien l'une d'entre elles: <!DOCTYPE HTML>

Document
{"color="red"} {"bgcolor="midnight-blue"} {"font-size="30%"} {"align="center"} {"text="strong"} {"police-text="time-new-roman"}

Vector String CVSS: 3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Severity Score CVSS: Critical 10.0 By timidhacker@hackerone.com

Name Of CWE: Unverified Password Change

CWE ID: CWE-620

Asset's Name Or Bug Bounty"s Prime: API For $990 000,00

EPSS: 0,04%

NVD Published Date: 17/07/2024
NVD Last Modified: 13/08/2024
Reported By Cisco System, Inc. Programmed By HackerOne To Share With NIST
Shygeek64 commented 3 months ago

Sur quoi dois-je appuyer pour déboguer mes pages web de vulnérabilités dans codespaces svp ? Et comment corriger les fautes d'écriture Web pour qu'on distingue mes langages de programmation: Je code en HTML, CSS et JavaScript et je ne vois pas en quels langages les associer, les balises, les accolades et les parenthèses, je ne sais rien de tout ça, je ne comprends pas