[Interest] Event from Javascript to WebEngineView

Jani Tykka jtykka at broadsoft.com
Fri Oct 28 09:02:33 CEST 2016


Hi,

How I can get events from JS to my QML WebEngineView? I'm trying something like:

in WebEngineView.LoadSucceededStatus
{
   var js = "window.addEventListener( \"message\", function(event) {
console.log( \"RECEIVED EVENT Result: \" ); } )"
   webViewLoader.item.runJavaScript( js, function(result) {
console.log( "Result: " + result); } )
}

This works, but I'd like to be able to declare JS function as a param
not the hardcoded string. I have found solutions like
http://stackoverflow.com/questions/8696448/how-to-emit-signals-from-javascript-to-qml/
but they require modifications on JS side which I'd like to avoid. Is
my ask even feasible?

Thanks,
Jani

-- 


This email is intended solely for the person or entity to which it is 
addressed and may contain confidential and/or privileged information. If 
you are not the intended recipient and have received this email in error, 
please notify BroadSoft, Inc. immediately by replying to this message, and 
destroy all copies of this message, along with any attachment, prior to 
reading, distributing or copying it.



More information about the Interest mailing list