Bug 227533

Summary: WKWebView: Application Cache is not working in an iframe with a different domain
Product: WebKit Reporter: Kiran S <18kirans>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: beidson, deepa.gopikuttan.pillai, ggaren, joji.jacob, kiran.satheesan, prabakar.paulsami, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: All   

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>