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

Commit

Permalink
Use landing page even if breakonload is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Raghav Katyal committed Mar 9, 2018
1 parent 7103bd0 commit ad3f470
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions src/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,11 @@ export class ChromeDebugAdapter extends CoreDebugAdapter {
}

if (launchUrl) {
if (this.breakOnLoadActive) {
// We store the launch file/url provided and temporarily launch and attach to about:blank page. Once we receive configurationDone() event, we redirect the page to this file/url
// This is done to facilitate hitting breakpoints on load
this._userRequestedUrl = launchUrl;
launchUrl = "about:blank";
}

// We store the launch file/url provided and temporarily launch and attach to about:blank page. Once we receive configurationDone() event, we redirect the page to this file/url
// This is done to facilitate hitting breakpoints on load
this._userRequestedUrl = launchUrl;
launchUrl = "about:blank";

chromeArgs.push(launchUrl);
}
Expand All @@ -132,7 +131,7 @@ export class ChromeDebugAdapter extends CoreDebugAdapter {
}

public configurationDone(): Promise<void> {
if (this.breakOnLoadActive && this._userRequestedUrl) {
if (this._userRequestedUrl) {
// This means all the setBreakpoints requests have been completed. So we can navigate to the original file/url.
this.chrome.Page.navigate({ url: this._userRequestedUrl });
}
Expand Down
2 changes: 1 addition & 1 deletion test/chromeDebugAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ suite('ChromeDebugAdapter', () => {
function spawn(chromePath: string, args: string[]): any {
assert(chromePath.toLowerCase().indexOf('chrome') >= 0);
assert(args.indexOf('--remote-debugging-port=9222') >= 0);
assert(args.indexOf('file:///c:/path%20with%20space/index.html') >= 0);
assert(args.indexOf('about:blank') >= 0); // Now we use the landing page for all scenarios
assert(args.indexOf('abc') >= 0);
assert(args.indexOf('def') >= 0);
spawnCalled = true;
Expand Down

0 comments on commit ad3f470

Please sign in to comment.