From 8b1f92a0a187bbe6c15cb32736bb3a2f80f25ff3 Mon Sep 17 00:00:00 2001 From: nehresma Date: Tue, 5 Sep 2017 14:12:54 -0400 Subject: [PATCH] Added optional support for javascript to the WebView (#134) --- src/android/Printer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/android/Printer.java b/src/android/Printer.java index e393a77..eb6b6dc 100644 --- a/src/android/Printer.java +++ b/src/android/Printer.java @@ -218,11 +218,15 @@ public class Printer extends CordovaPlugin { Activity ctx = cordova.getActivity(); view = new WebView(ctx); WebSettings settings = view.getSettings(); + final boolean jsEnabled = props.optBoolean("javascript", false); settings.setDatabaseEnabled(true); settings.setGeolocationEnabled(true); settings.setSaveFormData(true); settings.setUseWideViewPort(true); + if (jsEnabled) { + settings.setJavaScriptEnabled(jsEnabled); + } view.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); if (Build.VERSION.SDK_INT >= 21) {