<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [iOS8/9] WKProcess crashes leaving WKWebView instance blank"
   href="https://bugs.webkit.org/show_bug.cgi?id=148685">148685</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[iOS8/9] WKProcess crashes leaving WKWebView instance blank
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>iOS
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>iOS 8.4
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit2
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sleroux&#64;mozilla.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hey WebKit team,

I've been combing through the issues on here to see if this issue I'm seeing manifests itself in one of the bugs already filed but couldn't find an exact mapping so I figured I would post what I'm seeing and maybe get some help as to what the cause could be related to and a potential workaround.

Our app creates a WKWebView for each 'tab' a user has open where each contains a url and content the user has navigated to. After the app has sat in the background for ~1 hour, when the user returns to the app, there is a chance that one of the WKWebViews becomes blank and the url is gone with no way to recover. Some research has concluded that the WKProcess probably gets terminated in some way and the UIProcess WKWebView instance can't recover from it which leaves our WKWebView in this blank state. I've created a sample project and attached a more formal STR:

Sample project: <a href="https://github.com/sleroux/WKWebViewTest">https://github.com/sleroux/WKWebViewTest</a>

STR:

1. Launch sample app
2. Navigate to any url for each of the segmented WKWebViews
3. Leave the app in the background for &gt;= 1 hour
4. Return to the app

Expected:

WKWebView content should reload and display previously shown content

Actual:

WKWebView blanks out content and it's URL becomes nil with no way to recover

Notes:

1. Strangely, we've only been able to reproduce this on our TestFlight builds but not our distribution/enterprise or dev builds. The only thing I could think of that would be different is the difference in permissions between a TestFlight/App Store app and a dev/Ad Hoc build
2. Not sure if it's a coincidence but this seems to happen more frequently on older devices (5/5s) than newer ones (6/6+)

Lastly, we've tried some workarounds to this issue but haven't found anything that sticks. Additional discussion regarding the workarounds and this bug can be found here: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1194726">https://bugzilla.mozilla.org/show_bug.cgi?id=1194726</a>

Thanks for the help in advance! We'd really love to at least find a workaround for this.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>