Skip to content

Commit

Permalink
enabled java script for webview
Browse files Browse the repository at this point in the history
  • Loading branch information
Gautam committed Aug 16, 2019
1 parent 1b91ab0 commit ed20ddb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class HtmlToPdfConverter {
fun convert(filePath: String, activity: Activity, callback: Callback) {
val webView = WebView(activity.applicationContext)
val htmlContent = File(filePath).readText(Charsets.UTF_8)

webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.loadDataWithBaseURL(null, htmlContent, "text/HTML", "UTF-8", null)

webView.webViewClient = object : WebViewClient() {
override fun onPageFinished(view: WebView, url: String) {
super.onPageFinished(view, url)
Expand Down

0 comments on commit ed20ddb

Please sign in to comment.