Angular causing WKWebview to freeze

Situation

Our Angular+Bootstrap app is functioning smoothly in Desktop on all operating systems, as well as Android and iPhone devices. There are no visible JavaScript errors or CSS warnings.

Dilemma

However, an issue arises intermittently while using the app on an iPad when tapping a <a href="#screen2". This action triggers a change in the routerProvider to switch to a different screen controller and template. It appears as though a transparent layer is obstructing the entire screen, resulting in all events such as clicks, taps, and scrolling being disabled.

Anomaly

Interestingly, if we switch the device's orientation to landscape mode, the screen becomes responsive again. However, upon reverting back to portrait mode, the screen locks up once more.

Additional Information

We do not have the ability to update the WkWebview to a newer version; our control is limited to the web app itself. We understand that WkWebview has numerous issues related to scrolling, focus, and display changes, which can lead to blank screens or freezing. To prevent blank screens during certain focus events, we are utilizing the following script:

(function(){
  try{
      var a=navigator.userAgent;
      if((a.indexOf('Salesforce')!=-1)&&&(a.indexOf('iPhone')!=-1||a.indexOf('iPad')!=-1)&&&(a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1||a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1||a.indexOf('OS 10')!=-1||a.indexOf('OS/10')!=-1)&&&(a.indexOf('Safari')==-1)){
        var s=document.createElement('style'); 
        if(a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1) {
            s.innerHTML="html,body{overflow: auto;-webkit-overflow-scrolling:touch;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
        }
        else if(a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1) {
            s.innerHTML="html,body{overflow: auto;-webkit-overflow-scrolling:auto;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
        }
        else if(a.indexOf('OS/10')!=-1||a.indexOf('OS 10')!=-1) {
            s.innerHTML="html,body{overflow: auto;-webkit-overflow-scrolling:auto;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
        }
        document.getElementsByTagName('head')[0].appendChild(s);
      }
  } catch(e){}
})();

Inquiry

Are there any potential workarounds available to resolve this frustrating issue?

Thanks for your assistance

Answer №1

If you want a solution, it would be helpful to share the link for cross-checking.

1) Issue with Angular+Bootstrap application: Make sure your application is in production build mode. Check if the images and CSS files are minified and if they support DSN.

2) WkWebview issue: When testing your web application on Wkwebview, remember there may be some memory limitations. Before proceeding, review the configuration settings of the webview.

https://developer.apple.com/documentation/webkit/wkwebviewconfiguration

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

Animate a div's movement using an Angular directive

How can I make a description div animate from the bottom to the middle of an image when hovering over it, similar to this example here? I've tried implementing this on my product image using this plunker link, but I'm having trouble with the anim ...

Selecting parent class using JQuery

This is some HTML I have: <label class="rlabel">First Name</label> <input class="rinput" type="text" placeholder="Fisrt Name" required /> <label class="rlabel">Last Name</label> <input class="rinput" type="tex ...

Ways to update the content of a NodeList

When I execute this code in the console: document.querySelectorAll("a.pointer[title='Average']") It fetches a collection of Averages, each with displayed text on the page: <a class="pointer" title="Average" onclick="showScoretab(this)"> ...

Styling a webpage with a two-row layout using just CSS

I am looking to design a 2-row layout for a webpage where one row will contain filters and the other row will display results. The layout should meet the following criteria: The page height should not exceed 100% The first row's height will vary bas ...

Can we use a switch statement instead of having multiple @Input()s in Angular?

When passing an attribute into my Angular component like this: <my-component myAttribute></my-component> I aim to modify a variable within the component that controls the CSS properties for width and height. To simplify, I have predefined at ...

If the URL hash matches the ID of a specific div, then take action on the div's child element

Imagine I have the following HTML structure: <div class=".blog-item-holder"> <div id="AAAA"><div class="inner">AAAA</div></div> <div id="BBBB"><div class="inner">BBBB</div></div> <div id="CCCC">& ...

My backend axios post request is not returning any data to my external API. What could be the issue?

I've encountered an issue where I'm attempting to transmit data from my client-side using an ajax call to my backend axios post request, which is responsible for posting data to an external API URL. Despite receiving a 200 status code, none of th ...

Tips for effectively utilizing Mongoose models within Next.js

Currently, I am in the process of developing a Next.js application using TypeScript and MongoDB/Mongoose. Lately, I encountered an issue related to Mongoose models where they were attempting to overwrite the Model every time it was utilized. Here is the c ...

Troubleshooting Limitation Problem with Bootstrap Multiselect

I recently created a multiselect dropdown menu using Bootstrap Multiselect. I successfully set a limit on the number of options that can be selected (in this case, 5), and once the limit is reached, the additional options become disabled. Everything works ...

Extract the content of an element and incorporate it into a script (AddThis)

HTML: <div id="file-section"> <div class="middle"> <p class="description"> Lorem ipsum... </p> </div> </div> jQuery: var share_on_addthis = { description: $('#file-section ...

Is there a way to halt the polling process for the specific API handling the background task?

I have been using this polling function for executing background tasks. export const poll = ({ fn = () => {}, validate = (result) => !!result, interval = 1000, maxAttempts = 15, }) => { let attempts = 1; // eslint-disable-next-line con ...

Is there a way to determine the line height of a UILabel?

Is there a way to make a button appear as an extension of a label by adjusting its height to match the line height of the UILabel? What is the method for determining the line height of a UILabel? ...

What is the reason behind having all bindings resolved during each $digest cycle?

Upon placing a breakpoint on a bound function, I discovered that it is being triggered every cycle. This came as a surprise to me as the timer displaying a countdown on the page was updating other properties as well. The demonstration below showcases thre ...

Make sure to validate for null values when extracting data using the useSelector hook

Could someone help me with checking for null while destructuring data? const { vehicles: { data: { reminderVehicles }, }, } = useSelector((state) => state); The code snippet above is throwing an error message: Attempting to ...

How can I add text to the title of a border using Bootstrap5?

I am attempting to create a design where text appears within the border of an element. I am currently utilizing Bootstrap 5 and jQuery for this project. Despite my efforts with fieldset and legend elements, I have not been successful in achieving the desir ...

Utilizing absolute path in Typescript: A comprehensive guide

I am currently working on a project written in Typescript running on NodeJS. Within the project, I have been using relative paths to import modules, but as the project grows, this approach is becoming messy. Therefore, I am looking to convert these relativ ...

Assigning ng-model within a nested ng-repeat to use as parameters in an ajax request

How can I make an ajax call using ng-model values as parameters in my AngularJS project? Is it allowed to set ng-model to json data directly? Also, how should I set the scope for ng-model in the controller? Controller EZlearn.controller("testController", ...

The ForEach function does not execute actions on every individual object, but rather only once

I am currently developing a Deck building application for a card game. In addition, I have set up a database to manage the cards that I sell and play with. The deck builder tool I created allows me to deplete the stock of sellable cards when adding them to ...

Resetting md-radio-button choices within an Angular 2 application

My Angular app has a sorting filter using radio buttons via md-radio-group for users to choose how they want data displayed. The radio buttons work fine, but I'm struggling to clear them when the "Restore Defaults" button is clicked. This is the code ...

The Typescript function unexpectedly returns a NaN value even though it should be returning a

Having an issue with my countdown timer function: startTimer(duration) { this.myTimer = duration; setInterval(function () { this.myTimer--; console.log("TIMER: " + typeof(this.myTimer) + " " + this.myTimer); }, 1000); } When I ...