int SendDevToolsCmd(string json)

Send a Dev Tools command to the calling browser.

Security

Trust Level Required: Full Trust

Parameters

Name Description
json string
The JSON encoded Dev Tools command: https://chromedevtools.github.io/devtools-protocol/

Return

Returns an id that should be used to compare when OnDevToolsCmdResult is called, or 0 upon failure to queue command.

Remarks

After calling this function, OnDevToolsCmdResult and OnDevToolsMsg will be called in every browser and frame that has the required trust level. It is VERY IMPORTANT to compare the id with the id that was returned because it is possible that an internal KioWare action may cause the callbacks to be called.

Examples


var devCmd = {};
devCmd.method = "Browser.getVersion";
var id = KioBrowser.SendDevToolsCmd(JSON.stringify(devCmd));
if(!id) KioApp.LogWarn("SendDevToolsCmd fail");

function OnDevToolsCmdResult(id, res, isErr)
{
	KioApp.LogWarn("OnDevToolsCmdResult: "+id+": "+res+"\n"+isErr);
}
function OnDevToolsMsg(msg)
{
	KioApp.LogWarn("OnDevToolsMsg: "+msg);
}
    

Requirements

KioWare for Windows version 8.36 or greater.