diff --git a/src/chromeDebugAdapter.ts b/src/chromeDebugAdapter.ts index dc35b528..6a00420f 100644 --- a/src/chromeDebugAdapter.ts +++ b/src/chromeDebugAdapter.ts @@ -27,7 +27,7 @@ const DefaultWebSourceMapPathOverrides: ISourceMapPathOverrides = { }; export class ChromeDebugAdapter extends CoreDebugAdapter { - private static PAGE_PAUSE_MESSAGE = 'Paused in Visual Studio Code'; + private _pagePauseMessage = 'Paused in Visual Studio Code'; private _chromeProc: ChildProcess; private _overlayHelper: utils.DebounceHelper; @@ -88,6 +88,10 @@ export class ChromeDebugAdapter extends CoreDebugAdapter { chromeArgs.push('--user-data-dir=' + args.userDataDir); } + if (args._clientOverlayPausedMessage) { + this._pagePauseMessage = args._clientOverlayPausedMessage; + } + let launchUrl: string; if (args.file) { launchUrl = coreUtils.pathToFileURL(args.file); @@ -172,9 +176,10 @@ export class ChromeDebugAdapter extends CoreDebugAdapter { protected async onPaused(notification: Crdp.Debugger.PausedEvent, expectingStopReason = this._expectingStopReason): Promise { this._overlayHelper.doAndCancel(() => { - return this._domains.has('Overlay') ? - this.chrome.Overlay.setPausedInDebuggerMessage({ message: ChromeDebugAdapter.PAGE_PAUSE_MESSAGE }).catch(() => { }) : - (this.chrome).Page.configureOverlay({ message: ChromeDebugAdapter.PAGE_PAUSE_MESSAGE }).catch(() => { }); + + return this._domains.has('Overlay') ? + this.chrome.Overlay.setPausedInDebuggerMessage({ message: this._pagePauseMessage }).catch(() => { }) : + (this.chrome).Page.configureOverlay({ message: this._pagePauseMessage }).catch(() => { }); }); return super.onPaused(notification, expectingStopReason); diff --git a/src/chromeDebugInterfaces.d.ts b/src/chromeDebugInterfaces.d.ts index fc813c63..7a5d646e 100644 --- a/src/chromeDebugInterfaces.d.ts +++ b/src/chromeDebugInterfaces.d.ts @@ -21,6 +21,7 @@ export interface ILaunchRequestArgs extends Core.ILaunchRequestArgs, ICommonRequ port?: number; userDataDir?: string; breakOnLoad?: boolean; + _clientOverlayPausedMessage?: string; } export interface IAttachRequestArgs extends Core.IAttachRequestArgs, ICommonRequestArgs {