<?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>273906</bug_id>
          
          <creation_ts>2024-05-08 15:19:09 -0700</creation_ts>
          <short_desc>`navigator.storage.getDirectory()` fails in service workers with an `NotSupportedError: The operation is not supported`</short_desc>
          <delta_ts>2024-06-23 19:54:23 -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>Service Workers</component>
          <version>Safari 17</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=256712</see_also>
    
    <see_also>https://github.com/web-platform-tests/wpt/pull/46690</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jiwen Cai">steve</reporter>
          <assigned_to name="youenn fablet">youennf</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>cdumez</cc>
    
    <cc>karlcow</cc>
    
    <cc>sihui_liu</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2034126</commentid>
    <comment_count>0</comment_count>
    <who name="Jiwen Cai">steve</who>
    <bug_when>2024-05-08 15:19:09 -0700</bug_when>
    <thetext>This is different from https://bugs.webkit.org/show_bug.cgi?id=255458</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034146</commentid>
    <comment_count>1</comment_count>
    <who name="Jiwen Cai">steve</who>
    <bug_when>2024-05-08 16:17:38 -0700</bug_when>
    <thetext>To reproduce:


1. Go to https://opfs-in-service-worker.glitch.me/ in Chrome or Firefox.
2. Open the Console.
3. Note how calls to `navigator.storage.getDirectory()` succeed in the service worker.

4. Go to https://opfs-in-service-worker.glitch.me/ in Safari.
5. Open the Console.
6. Note how calls to `navigator.storage.getDirectory()` succeed in the main thread, web worker, but fail in a service worker with an `NotSupportedError`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034164</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-05-08 17:18:07 -0700</bug_when>
    <thetext>@Jiwen - is it recent regression and use to work earlier?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034165</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-05-08 17:18:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/127775672&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034168</commentid>
    <comment_count>4</comment_count>
    <who name="Jiwen Cai">steve</who>
    <bug_when>2024-05-08 17:21:15 -0700</bug_when>
    <thetext>Hi @Ahmad, this is the first time we attempted to use this. Not sure it&apos;s a regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034215</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-05-08 22:25:37 -0700</bug_when>
    <thetext>Probably Youenn might know about it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034920</commentid>
    <comment_count>6</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2024-05-13 07:01:12 -0700</bug_when>
    <thetext>We are exposing StorageManager to service workers but are not setting the service worker StorageProvider.
We should probably set the StorageProvider or alternatively disable StorageManager in service worker contexts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038312</commentid>
    <comment_count>7</comment_count>
    <who name="Jiwen Cai">steve</who>
    <bug_when>2024-05-28 15:52:21 -0700</bug_when>
    <thetext>Hey folks, thanks for taking a look at this. Supporting OPFS in service worker helps a lot for us to better managing large file caching using local storage. It&apos;s quite useful feature overall.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2040279</commentid>
    <comment_count>8</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2024-06-07 03:03:17 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/29615</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2040786</commentid>
    <comment_count>9</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2024-06-11 05:44:24 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/46690</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2040799</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-06-11 06:54:28 -0700</bug_when>
    <thetext>Committed 279908@main (c47f4cabd53d): &lt;https://commits.webkit.org/279908@main&gt;

Reviewed commits have been landed. Closing PR #29615 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2042696</commentid>
    <comment_count>11</comment_count>
    <who name="Jiwen Cai">steve</who>
    <bug_when>2024-06-23 19:54:23 -0700</bug_when>
    <thetext>Thanks for fixing this. Do we know which Safari version can be expect this to land?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>