public static WatiN_IE setJsObject(this WatiN_IE ie, object jsObject) { var toCSharpProxy = ie.injectJavascriptFunctions(); if (toCSharpProxy.notNull()) { toCSharpProxy.setJsObject(jsObject); ie.remapInternalJsObject(); } return(ie); }
public static object getJsObject(this WatiN_IE ie, string jsCommand) { var toCSharpProxy = ie.injectJavascriptFunctions(); if (toCSharpProxy.notNull()) { var command = "window.external.setJsObject({0})".format(jsCommand); ie.invokeEval(command); ie.remapInternalJsObject(); return(toCSharpProxy.getJsObject()); } return(null); }
public static bool doesJsObjectExists(this WatiN_IE ie, string jsCommand) { var toCSharpProxy = ie.injectJavascriptFunctions(); if (toCSharpProxy.notNull()) { var command = "window.external.setJsObject(typeof({0}))".format(jsCommand); ie.invokeEval(command); ie.remapInternalJsObject(); return(toCSharpProxy.getJsObject().str() != "undefined"); } return(false); }