mirror of
https://github.com/appium/appium.git
synced 2026-05-02 08:19:52 -05:00
add callFunctionOn capability to remote debugger
This commit is contained in:
@@ -123,6 +123,15 @@ RemoteDebugger.prototype.execute = function(command, cb) {
|
||||
this.send(sendJSCommand, cb);
|
||||
};
|
||||
|
||||
RemoteDebugger.prototype.callFunction = function(objId, fn, args, cb) {
|
||||
assert.ok(this.connId); assert.ok(this.appIdKey); assert.ok(this.senderId);
|
||||
assert.ok(this.pageIdKey);
|
||||
logger.info("Calling javascript function");
|
||||
var callJSFunction = messages.callJSFunction(objId, fn, args, this.appIdKey,
|
||||
this.connId, this.senderId, this.pageIdKey);
|
||||
this.send(callJSFunction, cb);
|
||||
};
|
||||
|
||||
// ====================================
|
||||
// HANDLERS
|
||||
// ====================================
|
||||
|
||||
@@ -52,6 +52,12 @@ exports.sendJSCommand = function(js, appIdKey, connId, senderId, pageIdKey) {
|
||||
{expression: js, returnByValue: true}, appIdKey, connId, senderId, pageIdKey);
|
||||
};
|
||||
|
||||
exports.callJSFunction = function(objId, fn, args, appIdKey, connId, senderId, pageIdKey) {
|
||||
return exports.command("Runtime.callFunctionOn",
|
||||
{objectId: objId, functionDeclaration: fn, arguments: args, returnByValue: true},
|
||||
appIdKey, connId, senderId, pageIdKey);
|
||||
};
|
||||
|
||||
exports.command = function(method, params, appIdKey, connId, senderId, pageIdKey) {
|
||||
var plist = {
|
||||
__argument: {
|
||||
|
||||
Reference in New Issue
Block a user