0

I'm using XWalkView stable 18.48.477.13 on android and wanted to disable javascript since it's by default enabled.

The standard android WebView has the method WebSettings.setjavascriptenabled to enable or disable JS.

So anyone knows how i could disable and reenable Javascript in XWalkView? Maybe its XWalkView.pauseTimers() and XWalkView.resumeTimers(), but it would affect all XWalkView instances which is not what i need in my case.

John Doe
  • 2,746
  • 2
  • 35
  • 50

2 Answers2

0

There's a class XWalkSettings just like WebSettings. But the method setJavaScriptEnabled in XWalkSettings is not yet exposed to external. This API will be available in Crosswalk-21.

lincsoon
  • 401
  • 3
  • 3
  • Thanks lincsoon, i'll keep an eye on it. Just out of curiosity, how do you know that and when it will be available? I googled for setJavascriptEnabled and didnt find anything relevant for crosswalk. – John Doe Jun 02 '16 at 07:13
  • I'm one of the developer of Crosswalk :-) – lincsoon Jun 03 '16 at 01:20
0

Now that CrossWalk 21 is released, you can do it like this:

xWalkView.getSettings().setJavaScriptEnabled(false);

and to activate it again:

xWalkView.getSettings().setJavaScriptEnabled(true);
Namnodorel
  • 385
  • 5
  • 17