Skip to content
This repository was archived by the owner on Sep 17, 2021. It is now read-only.

Commit ddf0fed

Browse files
committed
Prevent hitting a bp from switching to the sources tool
1 parent 4f486f3 commit ddf0fed

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/host/storage.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ devToolsFrame.onload = () => {
7878
set: function () { }
7979
});
8080

81+
// Override the paused event revealer so that hitting a bp will not switch to the sources tab
82+
const realLoadResource = (dtWindow as any).Runtime.loadResourcePromise as (url: string) => Promise<string>;
83+
(dtWindow as any).Runtime.loadResourcePromise = async function (url: string): Promise<string> {
84+
if (url === 'sources/module.json') {
85+
const content = await realLoadResource(url);
86+
return content.replace(/{[^}]+DebuggerPausedDetailsRevealer[^}]+},/gm, '');
87+
} else {
88+
return realLoadResource(url);
89+
}
90+
};
91+
8192
const reportError = function (name: string, stack: string) {
8293
const telemetry = {
8394
name: `devtools/${name}`,

0 commit comments

Comments
 (0)