<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>206741</bug_id>
          
          <creation_ts>2020-01-24 05:27:20 -0800</creation_ts>
          <short_desc>WKWebView support for Service Workers</short_desc>
          <delta_ts>2025-07-01 18:20:01 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Krzysztof Jan Modras [:chrmod]">krzysztof.modras</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>ajuma</cc>
    
    <cc>alexandros.sidiras</cc>
    
    <cc>andreas</cc>
    
    <cc>baena.francisco</cc>
    
    <cc>basix</cc>
    
    <cc>beidson</cc>
    
    <cc>bill</cc>
    
    <cc>costan</cc>
    
    <cc>jason.jeffrey</cc>
    
    <cc>krzysztof.modras</cc>
    
    <cc>landsman</cc>
    
    <cc>mjs</cc>
    
    <cc>nathan_wild</cc>
    
    <cc>tomac</cc>
    
    <cc>tristan.morris</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1610623</commentid>
    <comment_count>0</comment_count>
    <who name="Krzysztof Jan Modras [:chrmod]">krzysztof.modras</who>
    <bug_when>2020-01-24 05:27:20 -0800</bug_when>
    <thetext>iOS version of Safari has some service workers capabilities. Yet WKWebView does not implement any of those. 

Is there a plan to enable service workers or a way to contribute to make it happen?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1620578</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-02-19 01:56:45 -0800</bug_when>
    <thetext>&lt;rdar://problem/59584040&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1620579</commentid>
    <comment_count>2</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2020-02-19 01:59:31 -0800</bug_when>
    <thetext>We&apos;re looking into ways to enable this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1646575</commentid>
    <comment_count>3</comment_count>
    <who name="Victor Costan">costan</who>
    <bug_when>2020-04-28 11:30:01 -0700</bug_when>
    <thetext>The lack of Service Workers support in third-party browsers on iOS is hurting Chrome&apos;s AppCache removal efforts. AppCache is owned and will hopefully be removed by my team, and we would appreciate having Service Workers be available to all iOS browsers.

You can see a developer complaint at https://crbug.com/582750#c54.

My light searching turned up https://bugs.webkit.org/show_bug.cgi?id=182865, which suggests that WKWebView gates SW support on the com.apple.developer.WebKit.ServiceWorkers entitlement. I&apos;m told that the entitlement is not available in the app console.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943017</commentid>
    <comment_count>4</comment_count>
    <who name="Sung Jeon">basix</who>
    <bug_when>2023-03-21 21:00:08 -0700</bug_when>
    <thetext>Any updates on this issue? If the tweet by Maciej Stachowiak [1] is a valid solution, I think this issue can be closed by documenting that Service Workers would only work with App-Bound Domains.

[1]: https://twitter.com/othermaciej/status/1295434201865412608</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1963734</commentid>
    <comment_count>5</comment_count>
    <who name="tristan-morris">tristan.morris</who>
    <bug_when>2023-06-26 21:32:35 -0700</bug_when>
    <thetext>Trialling this today with AppBoundDomains set, navigator.serviceWorker is exposed. But workers can only be loaded via HTTP or HTTPS protocols. 

Workers can&apos;t be loaded from a custom URL scheme (at least if set via setURLSchemeHandler - https://developer.apple.com/documentation/webkit/wkwebviewconfiguration).

Ideally it would be possible to load workers from customproto://localhost/service-worker.js for example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1992457</commentid>
    <comment_count>6</comment_count>
    <who name="Nathan Wild">nathan_wild</who>
    <bug_when>2023-11-14 08:10:01 -0800</bug_when>
    <thetext>Is there an intention in the future to make this work with custom URL schemes for loading/registering the service worker?

There&apos;s a known limitation right now with apps that are solely built on wrappers creating a WKWebView to display their content (Cordova, Capacitor etc.) that service workers aren&apos;t a possible solution for handling offline content, passing authorization headers etc. on known requests.

For example, Capacitor uses its own custom URL scheme (capacitor://) to serve content as http/https are reserved for remote content, this alone would prevent service workers from being used as they would need to be served under that protocol instead, see https://github.com/ionic-team/capacitor/issues/7069.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2021348</commentid>
    <comment_count>7</comment_count>
    <who name="Michal">landsman</who>
    <bug_when>2024-03-15 08:55:01 -0700</bug_when>
    <thetext>Guys, please consider to enable this feature. Without it, the use of the web application within the web view is limited. For example, if you want to manage file uploads.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2081910</commentid>
    <comment_count>8</comment_count>
    <who name="Francisco Baena">baena.francisco</who>
    <bug_when>2024-12-15 15:27:46 -0800</bug_when>
    <thetext>Is there any update about supporting custom</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2081911</commentid>
    <comment_count>9</comment_count>
    <who name="Francisco Baena">baena.francisco</who>
    <bug_when>2024-12-15 15:35:39 -0800</bug_when>
    <thetext>(In reply to baena.francisco from comment #8)
&gt; Is there any update about supporting custom

... URL schemes/protocol to register Service Workers?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2092788</commentid>
    <comment_count>10</comment_count>
    <who name="">alexandros.sidiras</who>
    <bug_when>2025-02-07 06:51:42 -0800</bug_when>
    <thetext>Capacitor and Cordova apps use custom schemes in iOS (capacitor://localhost and ionic://localhost to serve the web apps).
It would be amazing to let those apps benefit from a service worker for runtime caching, preloading, background-sync and other Workbox utilities.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>