Skip to content
This repository was archived by the owner on Dec 6, 2022. It is now read-only.

Commit 4b71c96

Browse files
committed
Fix #689 - don't show the pause overlay if the debugger didn't actually pause
1 parent b3bebc6 commit 4b71c96

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

src/chromeDebugAdapter.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as os from 'os';
66
import * as fs from 'fs';
77
import * as path from 'path';
88

9-
import {ChromeDebugAdapter as CoreDebugAdapter, logger, utils as coreUtils, ISourceMapPathOverrides, ChromeDebugSession, telemetry, ITelemetryPropertyCollector } from 'vscode-chrome-debug-core';
9+
import {ChromeDebugAdapter as CoreDebugAdapter, logger, utils as coreUtils, ISourceMapPathOverrides, ChromeDebugSession, telemetry, ITelemetryPropertyCollector, IOnPausedResult } from 'vscode-chrome-debug-core';
1010
import { spawn, ChildProcess, fork, execSync } from 'child_process';
1111
import { Crdp } from 'vscode-chrome-debug-core';
1212
import { DebugProtocol } from 'vscode-debugprotocol';
@@ -285,15 +285,18 @@ export class ChromeDebugAdapter extends CoreDebugAdapter {
285285
];
286286
}
287287

288-
protected async onPaused(notification: Crdp.Debugger.PausedEvent, expectingStopReason = this._expectingStopReason): Promise<void> {
289-
this._overlayHelper.doAndCancel(() => {
288+
protected async onPaused(notification: Crdp.Debugger.PausedEvent, expectingStopReason = this._expectingStopReason): Promise<IOnPausedResult> {
289+
const result = (await super.onPaused(notification, expectingStopReason));
290290

291-
return this._domains.has('Overlay') ?
292-
this.chrome.Overlay.setPausedInDebuggerMessage({ message: this._pagePauseMessage }).catch(() => { }) :
293-
(<any>this.chrome).Page.configureOverlay({ message: this._pagePauseMessage }).catch(() => { });
294-
});
291+
if (result.didPause) {
292+
this._overlayHelper.doAndCancel(() => {
293+
return this._domains.has('Overlay') ?
294+
this.chrome.Overlay.setPausedInDebuggerMessage({ message: this._pagePauseMessage }).catch(() => { }) :
295+
(<any>this.chrome).Page.configureOverlay({ message: this._pagePauseMessage }).catch(() => { });
296+
});
297+
}
295298

296-
return super.onPaused(notification, expectingStopReason);
299+
return result;
297300
}
298301

299302
protected threadName(): string {

0 commit comments

Comments
 (0)