parent
9e412f4c7f
commit
4f5bf164df
File diff suppressed because one or more lines are too long
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue