Bug 144912 - WKWebView should expose _loadAlternateHTMLString:baseURL:forUnreachableURL:
Summary: WKWebView should expose _loadAlternateHTMLString:baseURL:forUnreachableURL:
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-12 07:30 PDT by Stefan Arentz
Modified: 2015-06-11 16:55 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Arentz 2015-05-12 07:30:45 PDT
Exposing WKWebView#_loadAlternateHTMLString:baseURL:forUnreachableURL: would allow people to us show error messages in-content while maintaining a sane BackForwardList.

The problem with the alternatives, loadHTML or loadRequest from an embedded HTTP Server, do not play well with the (read-only) BackForwardList.

When presenting an error with loadHTML, it will *replace* the current page you are on.

When presenting an error with loadRequest, either from embedded server or file: URL, it will generate a new entry in the BackForwardList that you cannot get rid of.

The _loadAlternateHTMLString:baseURL:forUnreachableURL API seems to add the failing page to the BackForwardList while presenting alternative content, like an error message. This means a call to reloadFromOrigin will simply retry the page and leave the BackForwardList in a good state that makes sense.
Comment 1 Stefan Arentz 2015-05-12 17:00:33 PDT
Would you accept a patch for exposing this functionality? I'm happy work with the WebKit team to produce something.
Comment 2 Radar WebKit Bug Importer 2015-06-11 16:55:50 PDT
<rdar://problem/21350071>