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

Commit

Permalink
Add baisc runtime.compileScript handlig
Browse files Browse the repository at this point in the history
  • Loading branch information
auchenberg committed Jun 23, 2017
1 parent 04a3ff0 commit 5d41e65
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/protocols/ios/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ export abstract class IOSProtocol extends ProtocolAdapter {
this._target.addMessageFilter('tools::Network.setMonitoringXHREnabled', (msg) => { msg.method = 'Console.setMonitoringXHREnabled'; return Promise.resolve(msg); });
this._target.addMessageFilter('tools::Network.canEmulateNetworkConditions', (msg) => this.onCanEmulateNetworkConditions(msg));

this._target.addMessageFilter('tools::Runtime.compileScript', (msg) => this.onRuntimeOnCompileScript(msg));
this._target.addMessageFilter('target::Runtime.executionContextCreated', (msg) => this.onExecutionContextCreated(msg));
this._target.addMessageFilter('target::Runtime.evaluate', (msg) => this.onEvaluate(msg));

this._target.addMessageFilter('target::Inspector.inspect', (msg) => this.onInspect(msg));
}

Expand Down Expand Up @@ -280,9 +281,9 @@ export abstract class IOSProtocol extends ProtocolAdapter {
msg.params.context.auxData = {
frameId: msg.params.context.frameId,
isDefault: true
}
}
delete msg.params.context.frameId
}
}
}

return Promise.resolve(msg);
Expand Down Expand Up @@ -316,6 +317,11 @@ export abstract class IOSProtocol extends ProtocolAdapter {
return Promise.resolve(msg);
}

private onRuntimeOnCompileScript(msg: any): Promise<any> {
msg.method = 'Runtime.evaluate'
return Promise.resolve(msg);
}

private onScriptParsed(msg: any): Promise<any> {
this._lastScriptEval = msg.params.scriptId;
return Promise.resolve(msg);
Expand Down

0 comments on commit 5d41e65

Please sign in to comment.