Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method shouldReloadWebView in CDVWebViewEngine misses condition, results in Blank Screen #1355

Open
rcorin opened this issue Jul 4, 2023 · 0 comments
Milestone

Comments

@rcorin
Copy link

rcorin commented Jul 4, 2023

Bug Report

Problem

I'm investigating a situation when the app comes to foreground from background and the webview content process has been killed by the OS.
In shouldReloadWebView , CDVWebViewEngine.m:283, there is this code:

BOOL title_is_nil = (title == nil);
BOOL location_is_blank = [[location absoluteString] isEqualToString:@"about:blank"];

BOOL reload = (title_is_nil || location_is_blank);

however location is nil, hence is false and also title_is_nil is false, resulting in reload being false.

What is expected to happen?

If the location is nil, reload should be true, so the condition should be:

BOOL location_is_blank = location == nil || [[location absoluteString] isEqualToString:@"about:blank"];

What does actually happen?

the app gets stuck in a white screen because the reload isn't issued, due to shouldReloadWebView being false.

Information

To reproduce the issue, i had to actually run the app in simulator, kill the com.apple.WebKit.WebContent process with the app in background, and then comment out the other webview reloads until reaching the point of shouldReloadWebView.

Command or Code

See above info.

Environment, Platform, Device

iOS simulator

Version information

Xcode 14.3, iOS 12, Cordoba 10.0.0.

Checklist

  • [X ] I searched for existing GitHub issues
  • [ X] I updated all Cordova tooling to most recent version
  • [ X] I included all the necessary information above
@dpogue dpogue added this to the 8.0.0 milestone Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants