Search code examples
javascriptqtwebkitrhino

Is the way to connect JS in embedded browser with native code?


Assume, that I use WebKit inside my Qt application. Can I get access to the JS context? For example, it can be used to provide some specific APIs for user JS or to provide custom constraints over JS code.


Solution

  • If I'm understanding the question correctly yes, with the addToJavaScriptWindowObject() method. Read the documentation about the QtWebKit Bridge for a more complete explanation.