diff --git a/lib/commands/execute.js b/lib/commands/execute.js index 56bbb3d3d..591d2e541 100644 --- a/lib/commands/execute.js +++ b/lib/commands/execute.js @@ -166,6 +166,8 @@ extensions.executeMobile = async function executeMobile (mobileCommand, opts = { listConditionInducers: 'mobileListConditionInducers', enableConditionInducer: 'mobileEnableConditionInducer', disableConditionInducer: 'mobileDisableConditionInducer', + + webInspector: 'mobileWebInspector', }; if (!_.has(commandMap, mobileCommand)) { diff --git a/lib/commands/web.js b/lib/commands/web.js index abe88373c..d3d990d27 100644 --- a/lib/commands/web.js +++ b/lib/commands/web.js @@ -201,6 +201,23 @@ commands.deleteCookies = async function deleteCookies () { return true; }; + +commands.mobileWebInspector = async function mobileWebInspector(opts) { + // TODO: add a security flag if we add this in the main + + if (this.remote) { + return false; + } + + const { method, args } = opts; + await this.remote.rpcClient.send(method, { + args, + appIdKey: this.remote.appIdKey, + pageIdKey: this.remote.pageIdKey, + }); + return true; +}; + helpers._deleteCookie = async function _deleteCookie (cookieName) { this.log.debug(`Deleting cookie '${cookieName}'`); let webCookie = cookieUtils.expireCookie(cookieName, {path: '/'});