Show debugger attach message (#21483)

Also spruce up branding
This commit is contained in:
Pranav K 2020-05-05 09:06:55 -07:00 committed by GitHub
parent 9e412f4c7f
commit 4f5bf164df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -10,6 +10,8 @@ export function hasDebuggingEnabled() {
}
export function attachDebuggerHotkey(resourceLoader: WebAssemblyResourceLoader) {
hasReferencedPdbs = !!resourceLoader.bootConfig.resources.pdb;
// Use the combination shift+alt+D because it isn't used by the major browsers
// for anything else by default
const altKeyName = navigator.platform.match(/^Mac/i) ? 'Cmd' : 'Alt';
@ -17,15 +19,13 @@ export function attachDebuggerHotkey(resourceLoader: WebAssemblyResourceLoader)
console.info(`Debugging hotkey: Shift+${altKeyName}+D (when application has focus)`);
}
hasReferencedPdbs = !!resourceLoader.bootConfig.resources.pdb;
// Even if debugging isn't enabled, we register the hotkey so we can report why it's not enabled
document.addEventListener('keydown', evt => {
if (evt.shiftKey && (evt.metaKey || evt.altKey) && evt.code === 'KeyD') {
if (!hasReferencedPdbs) {
console.error('Cannot start debugging, because the application was not compiled with debugging enabled.');
} else if (!currentBrowserIsChrome) {
console.error('Currently, only Edge(Chromium) or Chrome is supported for debugging.');
console.error('Currently, only Microsoft Edge (80+), or Google Chrome, are supported for debugging.');
} else {
launchDebugger();
}

View File

@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
{GetLaunchChromeInstructions(targetApplicationUrl)}
</p>
<p>
<h4>If you are using Microsoft Edge (Chromium) for your development, follow these instructions:</h4>
<h4>If you are using Microsoft Edge (80+) for your development, follow these instructions:</h4>
{GetLaunchEdgeInstructions(targetApplicationUrl)}
</p>
<strong>This should launch a new browser window with debugging enabled..</p>