mgks / Android-SmartWebView

A simple use webview integrated w/ native features to help create most advanced hybrid applications.
https://mgks.dev/smart-webview
MIT License
570 stars 278 forks source link

external link opens in webapp without being responsive #237

Closed Macof08 closed 3 years ago

Macof08 commented 3 years ago

I am opening an external link that opens directly in the APP, but it does not open responsive, if I enter the page in chrome it is, but in the webview it takes it with desktop view, any help @mgks ? Thanks

mgks commented 3 years ago

you may need to change the user agent, here's an example.

Macof08 commented 3 years ago

@mgks I use the variable ASWV_EXC_LIST, to open the link inside the webview, i want to see it in responsive like in chrome or other browser, but it still opens in desktop mode.

// domains allowed to be opened inside webview static String ASWV_EXC_LIST = "https://www.mercadopago.com.mx"; //separate domains with a

mgks commented 3 years ago

I don't get the mention of ASWV_EXC_LIST variable here. Have tried the solution I mentioned earlier?

Macof08 commented 3 years ago

Hello @mgks , It is already solved I did the following.

in main activity in this part. if(!ASWP_OFFLINE){ webSettings.setJavaScriptEnabled(ASWP_JSCRIPT); } webSettings.setSaveFormData(ASWP_SFORM); webSettings.setSupportZoom(ASWP_ZOOM); webSettings.setGeolocationEnabled(ASWP_LOCATION); webSettings.setAllowFileAccess(true); webSettings.setAllowFileAccessFromFileURLs(true); webSettings.setAllowUniversalAccessFromFileURLs(true); webSettings.setUseWideViewPort(true); webSettings.setDomStorageEnabled(true); webSettings.setJavaScriptEnabled(ASWP_JSCRIPT); webSettings.setLoadWithOverviewMode(true);

I add this:

webSettings.setJavaScriptEnabled(ASWP_JSCRIPT); webSettings.setLoadWithOverviewMode(true);

Thanks 👍