Enable evaluating in Chrome Console (#3405)

Chrome calls compileScript method when an expression is evaluated in the console. So to enable the console evaluate add an empty compileScript implementation.
Also send an Runtime.executionContextCreated which is needed for Console evaluation.
Both of the command and the event do not exist in the Webkit protocol, so we cannot use InspectorBackendCommands definition file
This commit is contained in:
KristinaKoeva
2017-01-09 11:01:47 +02:00
committed by Vladimir Enchev
parent a1cf0c1d6d
commit 6b2b05a1da

View File

@@ -3,6 +3,7 @@ var inspectorCommands: typeof inspectorCommandTypes = require("./InspectorBacken
import * as debuggerDomains from "./debugger"; import * as debuggerDomains from "./debugger";
declare var __inspectorSendEvent;
/** /**
* Checks if the property is a function and if it is, calls it on this. * Checks if the property is a function and if it is, calls it on this.
* Designed to support backward compatibility for methods that became properties. * Designed to support backward compatibility for methods that became properties.
@@ -247,3 +248,14 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
return resourceData; return resourceData;
} }
} }
@inspectorCommands.DomainDispatcher("Runtime")
export class RuntimeDomainDebugger {
constructor() {
__inspectorSendEvent(`{"method":"Runtime.executionContextCreated","params":{"context":{"id":1,"origin":"http://main.xml","name":"","auxData":{"isDefault":true,"frameId":"${frameId}"}}}}`);
}
compileScript(): { scriptId?: string, exceptionDetails?: Object } {
return {};
}
}