fix(debugger): Enable iOS inspector modules on creation

When the application is being debugged with `--debug-brk --bundle`
options, the JS implementation objects handling the debugging protocol
are created after their corresponding domains' `enable` methods have
been called by the debugger frontend. As a workaround we now manually
call `enable` in their constructors.

related to https://github.com/NativeScript/ios-runtime/issues/1055 and
https://github.com/NativeScript/ios-runtime/issues/1057
This commit is contained in:
Martin Bektchiev
2019-02-14 14:19:52 +02:00
parent 44b8acd79c
commit 1b5d3071e2
3 changed files with 29 additions and 17 deletions

View File

@ -18,6 +18,10 @@ export class CSSDomainDebugger implements inspectorCommandTypes.CSSDomain.CSSDom
this.commands = {};
attachCSSInspectorCommandCallbacks(this.commands);
// By default start enabled because we can miss the "enable" event when
// running with `--debug-brk` -- the frontend will send it before we've been created
this.enable();
}
get enabled(): boolean {

View File

@ -20,6 +20,10 @@ export class DOMDomainDebugger implements inspectorCommandTypes.DOMDomain.DOMDom
attachDOMInspectorEventCallbacks(this.events);
attachDOMInspectorCommandCallbacks(this.commands);
// By default start enabled because we can miss the "enable event when
// running with `--debug-brk` -- the frontend will send it before we've been created
this.enable();
}
get enabled(): boolean {

View File

@ -139,6 +139,10 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
constructor() {
this.events = new inspectorCommands.NetworkDomain.NetworkFrontend();
// By default start enabled because we can miss the "enable" event when
// running with `--debug-brk` -- the frontend will send it before we've been created
this.enable();
}
get enabled(): boolean {