+ case R.id.toggleJavaScript:
+ if (enableJavaScript) {
+ enableJavaScript = false;
+ menuItem.setChecked(false);
+ mainWebView.getSettings().setJavaScriptEnabled(false);
+ mainWebView.loadUrl(formattedUrlString);
+ } else {
+ enableJavaScript = true;
+ menuItem.setChecked(true);
+ mainWebView.getSettings().setJavaScriptEnabled(true);
+ mainWebView.loadUrl(formattedUrlString);
+ }
+ return true;
+
+ case R.id.toggleDomStorage:
+ if (enableDomStorage) {
+ enableDomStorage = false;
+ menuItem.setChecked(false);
+ mainWebView.getSettings().setDomStorageEnabled(false);
+ mainWebView.loadUrl(formattedUrlString);
+ } else {
+ enableDomStorage = true;
+ menuItem.setChecked(true);
+ mainWebView.getSettings().setDomStorageEnabled(true);
+ mainWebView.loadUrl(formattedUrlString);
+ }
+ return true;
+