<?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>194392</bug_id>
          
          <creation_ts>2019-02-07 08:15:52 -0800</creation_ts>
          <short_desc>Service Worker should see CSP violation reports</short_desc>
          <delta_ts>2019-04-26 10:17:09 -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 12</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>196807</dup_id>
          
          <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>cvazac</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ben</cc>
    
    <cc>cdumez</cc>
    
    <cc>dbates</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1503730</commentid>
    <comment_count>0</comment_count>
    <who name="">cvazac</who>
    <bug_when>2019-02-07 08:15:52 -0800</bug_when>
    <thetext>Step 3.4.2.3 here[0] omits the `service-workers mode`[1] enum, which defaults to `&quot;all&quot;`. This means that Service-Worker *should* get fetch events for CSP violations reports[2].

You can see a demo here[3]. When it&apos;s working, you will see this in the document:
Caught POST for https://84daacff2fb387fdf02f89b0fce73ef3.report-uri.com/r/d/csp/enforce)
{&quot;csp-report&quot;:{&quot;document-uri&quot;:&quot;https://vaz.ac/dev/csp/sw/index.html&quot;,&quot;referrer&quot;:&quot;&quot;,&quot;violated-directive&quot;:&quot;script-src-elem&quot;,&quot;effective-directive&quot;:&quot;script-src-elem&quot;,&quot;original-policy&quot;:&quot;default-src &apos;self&apos; &apos;unsafe-inline&apos;; report-uri https://84daacff2fb387fdf02f89b0fce73ef3.report-uri.com/r/d/csp/enforce&quot;,&quot;disposition&quot;:&quot;enforce&quot;,&quot;blocked-uri&quot;:&quot;https://ak.vaz.ac/dev/csp/sw/index.js&quot;,&quot;line-number&quot;:23,&quot;column-number&quot;:23,&quot;source-file&quot;:&quot;https://vaz.ac/dev/csp/sw/index.html&quot;,&quot;status-code&quot;:0,&quot;script-sample&quot;:&quot;&quot;}}

[0] https://w3c.github.io/webappsec-csp/#report-violation
[1] https://fetch.spec.whatwg.org/#request-service-workers-mode
[2] https://github.com/w3c/webappsec-csp/issues/383
[3] https://vaz.ac/dev/csp/sw/index.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503747</commentid>
    <comment_count>1</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-02-07 08:49:00 -0800</bug_when>
    <thetext>Currently, ping loads (beacon API, CSP violation reports) are not going through service workers. We should indeed fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503748</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-02-07 08:49:26 -0800</bug_when>
    <thetext>&lt;rdar://problem/47884547&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1530728</commentid>
    <comment_count>3</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-04-26 10:17:09 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 196807 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>