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

Commit

Permalink
Prevent hitting a bp from switching to the sources tool
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeMooseUS committed Nov 3, 2018
1 parent 4f486f3 commit ddf0fed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/host/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ devToolsFrame.onload = () => {
set: function () { }
});

// Override the paused event revealer so that hitting a bp will not switch to the sources tab
const realLoadResource = (dtWindow as any).Runtime.loadResourcePromise as (url: string) => Promise<string>;
(dtWindow as any).Runtime.loadResourcePromise = async function (url: string): Promise<string> {
if (url === 'sources/module.json') {
const content = await realLoadResource(url);
return content.replace(/{[^}]+DebuggerPausedDetailsRevealer[^}]+},/gm, '');
} else {
return realLoadResource(url);
}
};

const reportError = function (name: string, stack: string) {
const telemetry = {
name: `devtools/${name}`,
Expand Down

0 comments on commit ddf0fed

Please sign in to comment.