WebViewStringChange block

I want to use if..then block with the WebViewStringChange block.
But it is only running first if block with Screen1, the contains.text block with webviewer1.webviewstring and Notifier is not working, :thinking:
image
string for piece "empty" is existing of course.

What do you mean, it only works on Screen1? Are you loading the web page to a webviewer on the "other screen" and working on it so that it changes the webviewstring ?

Also learn to switch screens correctly and use the close screen block

Taifun

i mean only the if...then block is working with copying the value to screen1.
The loaded web page is loaded to a webviewer on Screen2, but not to other screen.
Only the else if block is not working. Maybe the webviewer.webviestring doesnt read the string correctly.
image

For switching screens correctly i will first build the apk and test again.

Are you setting the webviewstring with the word empty ?

this is only an example

image

The webviewstring must change for anything to happen...

Do you have example html for testing this ?

This is my example html.
I renamed it to .txt for upload
webviewer-test.txt (792 Bytes)

I do not see you getting or setting the webviewstring anywhere in your script/s ?

See here:

I thougt it will also work without setting the WebViewString in the html file, similar to this blog.
https://community.appinventor.mit.edu/t/webviewer-javascript-is-delayed/30770/11
Does the WebViewStringChange Block accept an If Block?

You want to run a javascript in the webviewer. If you use the webviewer then you need the webviewstring, otherwise, try with the extension customwebview. (which is what that link you provided refers to.