<?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>226382</bug_id>
          
          <creation_ts>2021-05-28 11:29:02 -0700</creation_ts>
          <short_desc>Prefetching cross-origin subresources for the current page gives double fetch</short_desc>
          <delta_ts>2023-01-25 05:02:19 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>Safari 14</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 11</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>
          <dependson>194539</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeff Kaufman">jeff.t.kaufman</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>beidson</cc>
    
    <cc>koivisto</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1764839</commentid>
    <comment_count>0</comment_count>
    <who name="Jeff Kaufman">jeff.t.kaufman</who>
    <bug_when>2021-05-28 11:29:02 -0700</bug_when>
    <thetext>When a page makes a cross-origin prefetch it&apos;s not used on that page.  To reproduce:

1. Turn on Develop &gt; Experimental Features &gt; LinkPrefetch (tested in Version 14.1)
2. Visit https://www.jefftk.com/test/prefetch/prefetch-nested
3. See that bg.css, log.js, and hello-world are immediately fetched
4. After waiting five seconds, see that they are fetched a second time (confirmed with server logs)

I tried adding &quot;as=&quot; attributes, without effect: https://www.jefftk.com/test/prefetch/prefetch-nested-as

It looks to me like the document is used for prefetching if I navigate to it instead of putting it in an iframe (https://www.jefftk.com/test/prefetch/prefetch-navigate).  This one does make some sense: if you prefetch a document you could plausibly either want to navigate the whole page to it, or navigate an iframe.  Chrome handles this the same way as Safari, while Firefox does the opposite; I&apos;ve filed https://github.com/whatwg/html/issues/6723</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1766854</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-06-04 11:29:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/78878195&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>