Newer Android versions running on KitKat (4.4) and beyond may experience incomplete page loading when using Chromium web

While most website pages perform well on Android 4.4 and newer versions with Chromium-based webview, I have encountered an issue wherein a particular page behaves differently between the newer versions and the earlier Android systems.

The webview functions as expected on older Android systems but not on KitKat. This disparity leads me to believe that there might be some hidden intricacies within the page that are causing this inconsistency. Despite dedicating weeks to resolving this matter, I remain stuck on this problem.

I kindly seek your assistance in deciphering this issue. Thank you in advance for your help.

Below are the provided codes:

WebView WV_test = (WebView) findViewById(R.id.WV_query);
WV_test.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
WV_test.getSettings().setDomStorageEnabled(true);
WV_test.getSettings().setJavaScriptEnabled(true);
WV_test.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
Log.v("attlog", "onPageStarted: url="+url);
super.onPageStarted(view, url, favicon);
}

@Override
public void onPageFinished(WebView view, String url) {
Log.v("attlog", "onPageFinished: url="+url);
super.onPageFinished(view, url);
}
@Override
public void onLoadResource(WebView view, String url) {
Log.v("attlog", "onLoadResource() url="+url);
super.onLoadResource(view, url);
}
});

String url="http://railway.hinet.net/ccancel_rt.jsp";
Log.v("attlog", "url="+url );
WV_test.loadUrl( url );

The outcome on the legacy webkit version (e.g., 4.1) aligns with expectations:

Displayed Output...

However, the results differ on the newer Chromium-based webkit versions like 4.4 onwards:

Displayed Output...

Your support is greatly appreciated.

Answer №1

To resolve any issues related to JavaScript execution in your WebView, try implementing a WebChromeClient. This could potentially fix the problem you are encountering with Javascript. You can find more information on this topic here: How to enable JavaScript in WebView

MyWebView.setWebChromeClient(new WebChromeClient());
MyWebView.loadUrl(...);

Have you attempted these changes? Do they make a difference?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

An issue has been encountered in the OBJLoader module within the THREE.JS library

I've been delving into the teachings of the Three.js library through the book "Learning Three.js: The JavaScript 3D Library for WebGL" and I've also downloaded the example sets from the corresponding GitHub repository https://github.com/josdirkse ...

What are the steps to programmatically click a JavaScript button with Selenium and Python?

Imagine there is a button on a webpage that looks like this: <input type="submit" name="next_btn" value="Next" onclick="gonext();" id="btnNext"> When manually clicked, it takes approximately 3-6 seconds for the page to reload and show new content. ...

Steps to Change the Default Value of Ant Design Date Picker upon Date or State Modification

AntD Version : 5.0 Upon loading the page, the default date is displayed, but I am passing a date stored in a state object. However, after successfully loading the page, changing the state of the date from one component does not update the default value of ...

Utilizing a TypeScript function to trigger an action from within a Chart.js option callback

Currently, I am utilizing a wrapper for Chart.js that enables an animation callback to signify when the chart has finished drawing. The chart options in my code are set up like this: public chartOptions: any = { animation: { duration: 2000, ...

JavaScript menu that pops up

Hello everyone, I've recently created an HTML5 file that, when clicked on a specific href link, is supposed to display an image in a smooth and elegant manner. However, so far it hasn't been working for me as expected. Instead of smoothly popping ...

My onClick AngularJS function contains a for loop that is not functioning properly upon initial click

When I click on a student's name in my AngularJS app, the program is supposed to show the student's full name and list of tuitions. However, I am encountering an issue where the for loop does not work on the first click, but it works fine on the ...

Javascript Egg Timer

I am currently in the process of developing a unique egg timer application that allows users to input values through various form select tags. However, I have encountered a NaN error when trying to set the timer with the JavaScript code provided below. H ...

Guide to implementing input fields in a form in React.js when the user chooses the "Other" option from a dropdown menu

For my project, I have implemented a multi-select dropdown input feature that saves all selected items in a useState array when the user clicks on the add icon. However, I am facing an issue where I need to render an input field only when the "Other" optio ...

What is the best way to link labels with input fields located separately in Angular?

Imagine a scenario where labels and form fields are being created in a *ngFor loop, as shown below: app.component.ts export class AppComponent { items = ['aaa', 'bbbbbb', 'ccccccccc'] } app.component.html <div class ...

Exploring the Dynamic Addition of Endpoints in Retrofit 2.0

Is there a way to dynamically pass endpoints in annotations? (e.g. @GET("dynamic value")) We had success using static values, but when attempting to pass values dynamically, we encountered the following error: Error: Attribute value must be constant. htt ...

Executing a jQuery code within a WordPress theme

I have been attempting to implement the following script within the header.php file of a Wordpress website: <script> jQuery(function($) { jQuery('[href=#membership]').attr( 'data-menu-top', '500' ); }); ...

Preventing CSRF Errors when activating API endpoints in Node Express JS by ensuring that bypassing the error message with next() function is ineffective

In this middleware block, I have implemented a mechanism to render a 404 page when an invalid CSRF token is detected. /* * Middleware for rendering 404 page on invalid csrf token */ this.app.use((err: any, req: Request, res: ...

Tips on transferring information from AngularJS to a remote server using ngResource

Looking for guidance on utilizing the ngResource module? To send data to a server. To retrieve data from a server. I am attempting to send data to a Solr server. Utilizing AngularJS API. Using npm package manager to install packages to my application. Th ...

Swap out the image source when the mouse hovers over it and revert back to the original when

Here is my HTML code for one larger image with two smaller thumbnails beneath it: <img src="../images/image.jpg" class="left main" alt="main image" /> <img src="../images/image2-thumb.jpg" class="left mainthumb" alt="image two" /> <img sr ...

Using destructuring assignment in a while loop is not functional

[a,b] = [b, a+b] is ineffective here as a and b are always set to 0 and 1. However, using a temporary variable to swap the values does work. function fibonacciSequence() { let [a, b, arr] = [0, 1, []] while (a <= 255) { arr.concat(a) [a, ...

Using a custom HTML file as a container in an Android WebView

I am trying to include each loaded page within my own custom HTML file. My app needs to first parse the loaded page, select the body tag, insert it into my custom HTML file, display it in a WebView, and continue this process for each subsequent page. I h ...

The content within the iframe is not displayed

I've set up a dropdown menu with separate iframes for each option. Here's the code I used: $(function(){ $('#klanten-lijst').on('change',function(){ $('#klanten div').hide(); $('.klant-'+t ...

Side-menu elevates slider

Struggling to keep my slider fixed when the side-menu slides in from the left? I've scoured for solutions without luck. Any expert out there willing to lend a hand? Code Snippet: https://jsfiddle.net/nekgunru/2/ ...

Ways to minimize an array using group by

I have a large dataset that needs to be grouped by COAGrpCode and ldgrGrp. Specifically, I need to sum the values of Opening, PrdDr, PrdCr, and Closing for each unique combination of COAGrpCode and ldgrGrp. Below is a sample of the data, which consists of ...

Is the validation for the 'prop' property missing in props?

Seeking assistance with react's forwardRef feature. Currently encountering errors related to missing props validation in FadeContents. Is there a way to resolve this issue? It seems like the props need to be defined somewhere in order to be used withi ...