WebSettings setJavaScriptEnabled - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for WebSettings setJavaScriptEnabled method.

This code example shows how to use the following methods:setJavaScriptCanOpenWindowsAutomatically, setJavaScriptEnabled, setLayoutAlgorithm
         
        appView.setInitialScale(100);
        appView.setVerticalScrollBarEnabled(false);
         
        WebSettings settings = appView.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
         
 
    	Package pack = this.getClass().getPackage();
    	String appPackage = pack.getName();
    	 
        WebViewReflect.setStorage(settings, true, "/data/data/" + appPackage + "/app_database/");
         
        /* Bind the appView object to the gap class methods */ 
        bindBrowser(appView);
         
        root.addView(appView);                   
        setContentView(root);                        
9
CodeRank
This code example shows how to use the following methods:setCacheMode, setDomStorageEnabled, setJavaScriptEnabled, setSaveFormData, setSavePassword
This code example shows how to use the following methods:setBuiltInZoomControls, setJavaScriptEnabled
	public void onActivityCreated(final Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		final WebView view = getWebView();
		view.setWebViewClient(new DefaultWebViewClient(getActivity()));
		final WebSettings settings = view.getSettings();
		settings.setBuiltInZoomControls(true);
		settings.setJavaScriptEnabled(true);
		WebSettingsAccessor.setAllowUniversalAccessFromFileURLs(settings, true);
	} 
 
	public static class DefaultWebViewClient extends WebViewClient {
 
		private final Activity mActivity;
		private final SharedPreferences mPreferences;
 
		public DefaultWebViewClient(final Activity activity) {
			mActivity = activity;
			mPreferences = activity.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
		} 
 
7
CodeRank
This code example shows how to use the following methods:setAppCacheEnabled, setAppCacheMaxSize, setDatabasePath, setDomStorageEnabled, setGeolocationEnabled
	} 
 
	@SuppressLint("SetJavaScriptEnabled") 
	public void configureSetting(WebViewBridge webViewBridge) {
		WebSettings settings = webViewBridge.getSettings();
		settings.setJavaScriptEnabled(true);
		settings.setJavaScriptCanOpenWindowsAutomatically(true);
		settings.setGeolocationEnabled(true);
		settings.setDomStorageEnabled(true);
		File databasePath = new File(mContext.getCacheDir(), "webstorage");
		settings.setDatabasePath(databasePath.toString());
		settings.setAppCacheEnabled(true);
		settings.setAppCacheMaxSize(1024 * 1024 * 4);
	} 
 
	// for test 
	public void setInjectorHelper(InjectorHelper injectorHelper) {
		mInjectorHelper = injectorHelper;
	} 
 
7
CodeRank
This code example shows how to use the following methods:setJavaScriptEnabled, setLightTouchEnabled, setPluginsEnabled
		setWebView(); 
	} 
 
	public void setWebView() { 
		WebSettings settings = webView.getSettings();
		settings.setJavaScriptEnabled(true);
		settings.setPluginsEnabled(true);
		settings.setLightTouchEnabled(true);
		webView.setWebViewClient(webClient);
		webView.post(new Runnable() {
			public void run() { 
				if (CLEAR_CACHE_ON_LOAD) {
					webView.clearCache(true);
				} 
				webView.loadUrl(url);
			} 
		}); 
 
	} 
 
7
CodeRank
This code example shows how to use the following methods:setJavaScriptEnabled, setSaveFormData, setSavePassword, setSupportZoom
				return true; 
			} 
		}); 
		 
		WebSettings webSettings = webView.getSettings();
		webSettings.setSavePassword(false);
		webSettings.setSaveFormData(false);
		webSettings.setJavaScriptEnabled(true);
		webSettings.setSupportZoom(false);
		 
		NMEWebView.webView = webView;
		NMEWebView.view = NMEWebView.webView;
		 
		if(withPopup) {
			webView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
			 
			ImageView closeImageView = new ImageView(GameActivity.getContext());
			closeImageView.setOnClickListener(new View.OnClickListener() {
				@Override 
				public void onClick(View v) {
7
CodeRank
This code example shows how to use the following methods:setJavaScriptEnabled, setLayoutAlgorithm, setSupportZoom
This code example shows how to use the following methods:setBuiltInZoomControls, setJavaScriptEnabled, setLightTouchEnabled, setLoadWithOverviewMode, setLoadsImagesAutomatically
This code example shows how to use the following methods:setAppCacheEnabled, setJavaScriptEnabled
 
		 
		WebView 	view 	 = new WebView(activity);
		WebSettings settings = view.getSettings();  
         
		settings.setJavaScriptEnabled(true);  
		settings.setAppCacheEnabled(false);
         
		view.setWebViewClient( new WebViewClient() {
			@Override 
			public void onPageStarted( WebView view, String url, Bitmap favicon ) {
				if( mLoader == null )
					mLoader = ProgressDialog.show( activity, "", "Loading changelog ..." );
				 
				super.onPageStarted(view, url, favicon);
			} 
 
			@Override 
			public void onPageFinished( WebView view, String url ) {
				super.onPageFinished(view, url);
7
CodeRank
This code example shows how to use the following methods:setJavaScriptEnabled, setSaveFormData, setSavePassword, setSupportZoom
	@Override 
	protected void onCreate(Bundle bundle){
		super.onCreate(bundle);
		WebView mWebView = new WebView(this);
		WebSettings webSettings = mWebView.getSettings();
        webSettings.setSavePassword(false);
        webSettings.setSaveFormData(false);
        webSettings.setJavaScriptEnabled(true);
        webSettings.setSupportZoom(true);
         
        mWebView.loadUrl("file:///android_asset/BSTOverview.html");
        setContentView(mWebView);
	} 
} 
6
CodeRank

Related WebSettings setJavaScriptEnabled Questions & Answers:

Other WebSettings setJavaScriptEnabled Examples

20:			
21:			webview = (WebView) findViewById(R.id.webpage);
22:			webview.getSettings().setJavaScriptEnabled(true);
23:			webview.loadUrl(page_url);
24:

Read More

setJavaScriptEnabled Method Overview
Tells the WebView to enable JavaScript execution.
See Code Examples for other Android WebSettings Methods: