<?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>186278</bug_id>
          
          <creation_ts>2018-06-04 12:45:42 -0700</creation_ts>
          <short_desc>[WPE][GTK] Cannot download main resource for media files</short_desc>
          <delta_ts>2020-05-18 01:24:48 -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>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=186276</see_also>
    
    <see_also>https://bugzilla.gnome.org/show_bug.cgi?id=746737</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>agomez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>pnormand</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1429867</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-06-04 12:45:42 -0700</bug_when>
    <thetext>In Epiphany, visit either of these resources, then right click and &quot;Save Page As&quot;:

Audio: https://upload.wikimedia.org/wikipedia/commons/9/90/Papalotla-sound.ogg

Video: https://upload.wikimedia.org/wikipedia/commons/3/35/Nerven_(1919).webm

Don&apos;t use &quot;Save Video As&quot; since that works fine. If you instead use &quot;Save Page As&quot; the browser will crash due to bug #186276. But with the patch from that bug to fix the crash, it still fails to download the media. I&apos;ve been debugging a little bit:

 * In WebPage::getMainResourceDataOfFrame, frame-&gt;coreFrame()-&gt;loader().documentLoader() returns a valid DocumentLoader, but then loader-&gt;mainResourceData() returns nullptr. Bad. Turns out DoucmentLoader::m_mainResourceData is nullptr.
 * Why? Not sure, I haven&apos;t dived in deep enough. But it seems that webkitWebViewResourceLoadStarted (in WebKitWebView.cpp) gets called *three* times, instead of once, as I would expect. WebKitWebView assumes the first resource load is the main resource, which seems like it should be a safe assumption, but I&apos;m going to guess that the real main resource is the third one (not sure). Looks like something weird is going on inside WebCore. Requires further investigation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1429871</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-06-04 12:54:38 -0700</bug_when>
    <thetext>BTW what Epiphany is doing here is (1) webkit_web_view_get_main_resource() then (2) webkit_web_resource_get_data().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1555031</commentid>
    <comment_count>2</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2019-07-23 03:45:49 -0700</bug_when>
    <thetext>I can&apos;t reproduce this with Ephy TP 3.33.4-29-gf6bb1bce5 and I doubt it&apos;s related with GStreamer anyway.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1555037</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-07-23 06:40:13 -0700</bug_when>
    <thetext>This one is fixed!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1632652</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-03-22 10:23:25 -0700</bug_when>
    <thetext>Reopening. I closed this in error; it&apos;s not fixed after all. Since r243608, the files are now &quot;successfully&quot; downloaded instead of crashing the UI process, but they are one-byte files containing only a NULL byte.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>