WebViewer Interact Extension


#1

With this Extension you can interact more advanced with your web page.

  1. You can directly open DataURL with the LoadData method.
  2. Use BaseData Encrypted DataURL with LoadDataWithBaseURL
    If you think that the above two methods are too much trouble, then you can directly call LoadHTMLCode to open an html page
  3. If you uploaded an html file, you can use LoadHTMLFile to open the web page.
  4. Of course you can use the RunJS method to execute javascript code more efficiently than the “javascript:” protocol.

The most powerful function is the event.

  1. When the RunJS method finishes executing the javascript code, if there is a return value, the event “OnReceiveValue” is called to get the return value.
  2. The “OnJsAlert” event is triggered when javascript executes the “alert” method.
  3. The “OnConsoleMessage” event is triggered when javascript executes the “console.log” method.
  4. When the Extension is initialized

cn.zzq.WebUI.WebUI.aix (20.8 KB)

WebTools.aia (23.2 KB)


HTML with Thunkable
#2

Hello @Zhangzqs I used yout extension but I’m stucked help me!!
I’m using Youtube javascript and i want to get when video is buffering…
But .onRecieveResult returns null
Here is my code-
function onPlayerReady(event) {
event.target.playVideo();
event.target.setPlaybackQuality(small);
}
function onPlayerStateChange(event) {
switch(event.data) {
case 0:
record(‘video ended’);
break;
case 1:
record('video playing at '+player.getCurrentTime());
break;
case 2:
record('video paused at '+player.getCurrentTime());
case 3:
record('video buffering at '+player.getCurrentTime());
}
}
function record(str){
var p = document.createElement(“p”);
p.appendChild(document.createTextNode(str));
document.body.appendChild§;
}


I want to get (event.data) .
Thank You