Skip to content

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

@rcorin

Description

@rcorin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions