Chromely allows JavaScript execution in C# code via implementaion of IChromelyJavaScriptExecutor. A default implementation is provided but this is can be changed via registration of a custom executor.
For sample execution see - JavaScript Execution.
To register a custom exeuctor:
var config = DefaultConfiguration.CreateForRuntimePlatform();
config.JavaScriptExecutor = new CustomJavaScriptExecutor();
public class CustomJavaScriptExecutor : IChromelyJavaScriptExecutor
{
}
To "Execute" a script on the main frame, a "frameName" is not required. To "Execute" on an iframe a "frameName" is required. To get the "frameName", the developer will have to declare that in the iframe object.
<iframe id="demoframe" name="alldemoframe" .. />
</div>
var javaScriptExecutor = new CustomJavaScriptExecutor()
javaScriptExecutor.Execute(script);
var javaScriptExecutor = new CustomJavaScriptExecutor()
javaScriptExecutor.Execute("alldemoframe", script);