Bug 227533 - WKWebView: Application Cache is not working in an iframe with a different domain
Summary: WKWebView: Application Cache is not working in an iframe with a different domain
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Other
Hardware: iPhone / iPad All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-30 09:31 PDT by Kiran S
Modified: 2021-07-21 00:19 PDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kiran S 2021-06-30 09:31:12 PDT
Overview

    In WKWebView Application cache does not initialize correctly when loaded in an iframe from a different domain.
    This was also observed on Safari iOS and MacOS, but since Safari has Service Worker support it is not an issue.

    Note: Although Application Cache is a deprecated technology. In WKWebView it is the only option for offline support with Non App Bound Domains where service worker is not available.


Steps to Reproduce
    
    1. Load "https://ksdev.app/iframe.html" in iOS WKWebView or Safari. 
       This page automatically embeds a different domain iframe which uses app cache. The app cache state changes are also indicated via alerts

Actual Result
    
    Appcache goes from "Checking" state to "Error" state. Initialisation does not complete.

Expected Result

    Appcache loads without any error.


Additional Info

    Our app uses a WKWebVieW and we have a use case where it is necessary to load external URL's as iframes. These URL's are expected to work in offline as well.
    These URL's are provided by the customer and its not possible to know them before hand. So App Bound Domains are not feasible in this case. Application cache seems to be the only option.
Comment 1 Radar WebKit Bug Importer 2021-07-07 09:32:23 PDT
<rdar://problem/80273924>