Is there any way to Detect Link Click on Web Viewer?
Unfortunately no.
Think again
Yes, there is a way to detect click on Web Viewer with WebViewString
feature.
If you change WebViewString value in your website with JavaScript, it will trigger App Inventor app, and you can do any actions you want, and also you can get/set WebViewString data.
It is a very useful feature sharing data between App Inventor app and website.
For example this code sets the WebViewString to āHiā.
window.AppInventor.setWebViewString("Hi!");
If you own the website
When you put this JavaScript code in your website, you can get this value in App Inventor app and in your website too.
More details from MIT App Inventor website:
http://appinventor.mit.edu/explore/ai2/webview-javascript.html
A basic snippet by Pura Vida Apps (Taifun):
http://puravidaapps.com/snippets.php#2webviewstring
But if you are trying to detect someoneās website click
You can inject WebViewString setter code to onclick
and href
for all website elements with Executing JavaScript.
Thanks
I want to detect clicks on third party website links.
can you please explain more how to inject WebViewString setter code to onclick
and href
for all website elements with Executing JavaScript.
I can write a tutorial today about that.
So sorry about that Because of my school and other jobs, I canāt find time for that. But I will make soon.
Can you now explain me how to do so.
That would be very Helpful.
This page has been saved in my browser for 7 days waiting for the answer on how to use the