Skip to content

Commit d96acc5

Browse files
committed
Add query param to check if Blazor WASM app is under debug
1 parent 524c8cd commit d96acc5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Components/Web.JS/dist/Release/blazor.webassembly.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/src/Platform/Mono/MonoDebugger.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ import { WebAssemblyResourceLoader } from '../WebAssemblyResourceLoader';
33
const currentBrowserIsChrome = (window as any).chrome
44
&& navigator.userAgent.indexOf('Edge') < 0; // Edge pretends to be Chrome
55

6+
let isDebugging = true;
7+
8+
window.addEventListener('load', () => {
9+
const params = new URLSearchParams(window.location.search);
10+
isDebugging = params.get('_blazor_debug') === 'true';
11+
})
12+
613
let hasReferencedPdbs = false;
714

815
export function hasDebuggingEnabled() {
9-
return hasReferencedPdbs && currentBrowserIsChrome;
16+
return isDebugging && hasReferencedPdbs && currentBrowserIsChrome;
1017
}
1118

1219
export function attachDebuggerHotkey(resourceLoader: WebAssemblyResourceLoader) {

0 commit comments

Comments
 (0)