Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ public async Task Display(HttpContext context)
var debuggerTabsListUrl = $"{_browserHost}/json";
IEnumerable<BrowserTab> availableTabs;

var targetApplicationUrlEncoded = WebUtility.HtmlEncode(targetApplicationUrl.ToString());
var debuggerTabsListUrlEncoded = WebUtility.HtmlEncode(debuggerTabsListUrl);
Comment thread
maraf marked this conversation as resolved.

try
{
availableTabs = await GetOpenedBrowserTabs();
Expand All @@ -342,17 +345,17 @@ public async Task Display(HttpContext context)
await context.Response.WriteAsync($@"
<h1>Unable to find debuggable browser tab</h1>
<p>
Could not get a list of browser tabs from <code>{debuggerTabsListUrl}</code>.
Could not get a list of browser tabs from <code>{debuggerTabsListUrlEncoded}</code>.
Ensure your browser is running with debugging enabled.
</p>
<h2>Resolution</h2>
<p>
<h4>If you are using Google Chrome or Chromium for your development, follow these instructions:</h4>
{GetLaunchChromeInstructions(targetApplicationUrl.ToString())}
{GetLaunchChromeInstructions(targetApplicationUrlEncoded)}
</p>
<p>
<h4>If you are using Microsoft Edge (80+) for your development, follow these instructions:</h4>
{GetLaunchEdgeInstructions(targetApplicationUrl.ToString())}
{GetLaunchEdgeInstructions(targetApplicationUrlEncoded)}
Comment thread
lewing marked this conversation as resolved.
</p>
<strong>This should launch a new browser window with debugging enabled..</p>
Comment thread
lewing marked this conversation as resolved.
<h2>Underlying exception:</h2>
Expand All @@ -378,8 +381,8 @@ Ensure your browser is running with debugging enabled.

var suffix = string.IsNullOrEmpty(targetApplicationUrl)
? string.Empty
: $" matching the URL {WebUtility.HtmlEncode(targetApplicationUrl)}";
await context.Response.WriteAsync($"<p>The list of targets returned by {WebUtility.HtmlEncode(debuggerTabsListUrl)} contains no entries{suffix}.</p>");
: $" matching the URL {targetApplicationUrlEncoded}";
await context.Response.WriteAsync($"<p>The list of targets returned by {debuggerTabsListUrlEncoded} contains no entries{suffix}.</p>");
await context.Response.WriteAsync("<p>Make sure your browser is displaying the target application.</p>");
}
else
Expand Down
Loading