Set injectDebuggingSupportCode in DWDS based on specified device ID (#165820)

This change ensures that `injectDebuggingSupportCode` in DWDS is set
based on the specified device ID, defaulting to Chrome. This complements
the changes made in https://github.com/dart-lang/webdev/pull/2601 and
ensures that debugging support is correctly configured for different
environments.

fixes https://github.com/dart-lang/sdk/issues/60289
This commit is contained in:
Jessy Yameogo
2025-03-24 16:06:05 -04:00
committed by GitHub
parent 85235a41f6
commit 45d86cf670
2 changed files with 7 additions and 2 deletions

View File

@@ -49,6 +49,7 @@ typedef DwdsLauncher =
required Stream<BuildResult> buildResults,
required ConnectionProvider chromeConnection,
required ToolConfiguration toolConfiguration,
bool injectDebuggingSupportCode,
});
// A minimal index for projects that do not yet support web. A meta tag is used
@@ -428,6 +429,10 @@ class WebAssetServer implements AssetReader {
),
appMetadata: AppMetadata(hostname: hostname),
),
// Defaults to 'chrome' if deviceManager or specifiedDeviceId is null,
// ensuring the condition is true by default.
injectDebuggingSupportCode:
(globals.deviceManager?.specifiedDeviceId ?? 'chrome') == 'chrome',
);
shelf.Pipeline pipeline = const shelf.Pipeline();
if (enableDwds) {