0

Is there a way I can read the content of webview after the page is loaded in android using nativescript.

I am using this webview : https://docs.nativescript.org/angular/ui/ng-ui-widgets/web-view I find this SO: get content of webview in nativescript But here is not solution for android. It leads to How do I get the web page contents from a WebView?, but here is solution for android, but I am not sure how solve it in NS on Android.

What with: MyJavaScriptInterface with decorators or how set setWebViewClient(new WebViewClient() { in NS

Thanks

Petr
  • 89
  • 10
  • Possible duplicate of [How do I get the web page contents from a WebView?](https://stackoverflow.com/questions/2376471/how-do-i-get-the-web-page-contents-from-a-webview) – Ian MacDonald Sep 28 '18 at 13:20
  • See this answer: https://stackoverflow.com/a/4892013/2708650 (linked from the question/answer you provided in your question). – Ian MacDonald Sep 28 '18 at 13:20
  • I dont think that is duplicate, because of I find solution for nativescript. I am not sure how define and call calbacks in NS for Android. For example this: browser.addJavascriptInterface(new MyJavaScriptInterface(), "HTMLOUT"); – Petr Sep 30 '18 at 07:05

1 Answers1

1

I already solve it and I used this NS plugin Nota NativeScript Webview Ext: https://market.nativescript.org/plugins/@nota%2Fnativescript-webview-ext

In angular project is needed import it in app.module.ts for register WebViewExt element.

Petr
  • 89
  • 10