Manipulating the webview

Hi,

Just a quick question, is is possible to search a web page using the native.newWebView or native.showWebPopup?

Many thanks,

Matt

Hi Matt, 

I suppose you mean searching inside the contents of a webview? 

You could possible get the HTML of the URL using network.request and then search in it? You could grab the webview URL events as follows:

function websiteView1Listener( event ) -- print event type and URL print("Event type: "..event.type) print("URL: "..event.url) \<\<fetch event.url using network request and do your stuff\>\> end websiteView1 = native.newWebView( display.contentWidth \* 0.5, display.contentHeight \* 0.5, 300, 300 ) websiteView1:request( "www.myWebviewURL.com") websiteView1:addEventListener( "urlRequest", websiteView1Listener )

Hope this helps!

Hi Matt, 

I suppose you mean searching inside the contents of a webview? 

You could possible get the HTML of the URL using network.request and then search in it? You could grab the webview URL events as follows:

function websiteView1Listener( event ) -- print event type and URL print("Event type: "..event.type) print("URL: "..event.url) \<\<fetch event.url using network request and do your stuff\>\> end websiteView1 = native.newWebView( display.contentWidth \* 0.5, display.contentHeight \* 0.5, 300, 300 ) websiteView1:request( "www.myWebviewURL.com") websiteView1:addEventListener( "urlRequest", websiteView1Listener )

Hope this helps!