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

Expose chrome connection events and clients to extending class #119

Merged
merged 1 commit into from
Oct 14, 2016

Conversation

iradul
Copy link
Contributor

@iradul iradul commented Oct 14, 2016

hookConnectionEvents function will allow custom adapter class that
extends ChromeDebugAdapter to listen to events that are not handled by
base ChromeDebugAdapter class.

runConnection function will allow custom class to enable clients other
than Debugger and Runtime which are the only one currently enabled.

iradul/vscode-phantomjs-debug#5

hookConnectionEvents function will allow custom adapter class that
extends ChromeDebugAdapter to listen to events that are not handled by
base ChromeDebugAdapter class, for example :
 protected hookConnectionEvents(cc: ChromeConnection): void {
   cc.on('Console.messageAdded', (msg) => this.onConsoleMessageAdded(msg));
   return super.hookConnectionEvents(cc);
 }

runConnection function will allow custom class to enable clients other
than Debugger and Runtime which are the only one currently enabled, for
example :
 protected runConnection(): Promise<void>[] {
   let a = super.runConnection();
   a.push(this.chrome.Console.enable());
   return a;
 }
@msftclas
Copy link

Hi @iradul, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@roblourens
Copy link
Member

Thanks for the PR! I agree that this is needed for subclassing, because you want to do this in that time between attach and firing 'initialized'.

I'm actually in the middle of changing this to use the typed events instead of 'on', so note that chromeConnection.on will go away in favor of stuff like this -
this.chrome.Debugger.onPaused(params => this.onPaused(params));.

@roblourens roblourens merged commit 631f049 into microsoft:master Oct 14, 2016
roblourens added a commit that referenced this pull request Jul 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants