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

Commit

Permalink
Merge pull request #599 from Microsoft/raghav_overlay
Browse files Browse the repository at this point in the history
Changing overlay text based on clients
  • Loading branch information
roblourens authored Feb 14, 2018
2 parents 1d85c40 + ce9ee18 commit 02c240f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -172,9 +176,10 @@ export class ChromeDebugAdapter extends CoreDebugAdapter {

protected async onPaused(notification: Crdp.Debugger.PausedEvent, expectingStopReason = this._expectingStopReason): Promise<void> {
this._overlayHelper.doAndCancel(() => {
return this._domains.has('Overlay') ?
this.chrome.Overlay.setPausedInDebuggerMessage({ message: ChromeDebugAdapter.PAGE_PAUSE_MESSAGE }).catch(() => { }) :
(<any>this.chrome).Page.configureOverlay({ message: ChromeDebugAdapter.PAGE_PAUSE_MESSAGE }).catch(() => { });

return this._domains.has('Overlay') ?
this.chrome.Overlay.setPausedInDebuggerMessage({ message: this._pagePauseMessage }).catch(() => { }) :
(<any>this.chrome).Page.configureOverlay({ message: this._pagePauseMessage }).catch(() => { });
});

return super.onPaused(notification, expectingStopReason);
Expand Down
1 change: 1 addition & 0 deletions src/chromeDebugInterfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 02c240f

Please sign in to comment.