In an iOS app, I used
stringFromJavaScript = [webView stringByEvaluatingJavascriptFromString:@"document.getElementById(\"image\").getAttribute(\"src")"];
To get the src directory of the image that was being displayed on the webView. I want to do the same for Android. What are my options?
Basically the intent is to capture the path so that I can email this same picture...
ie.
"picture.php?image=%@",stringFromJavascript
This way, that same image would be loaded when the user clicks the link, or posts it to facebook etc.
WebView.loadURL()
apparently usesstringByEvaluatingJavascriptFromString()
internally when the URL scheme isjavascript
. github.com/android/platform_frameworks_base/blob/master/core/… – Shaynashayne