<?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>181648</bug_id>
          
          <creation_ts>2018-01-15 06:55:05 -0800</creation_ts>
          <short_desc>Service worker postMessage</short_desc>
          <delta_ts>2018-01-16 01:29:14 -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 Technology Preview</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.13</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>178940</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Stephan Coertzen">coertzen.jfs</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>beidson</cc>
    
    <cc>cdumez</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1389287</commentid>
    <comment_count>0</comment_count>
    <who name="Stephan Coertzen">coertzen.jfs</who>
    <bug_when>2018-01-15 06:55:05 -0800</bug_when>
    <thetext>Still getting Error: Passing MessagePort objects to postMessage is not yet supported
postMessage@[native code]

Code: 
                                var msg_chan = new MessageChannel();
                                msg_chan.port1.onmessage = function(event) {
                                    if (event.data.error) {
                                        console.log(event.data.error, true);
                                    } else {
                                        Web.AppCache.ServiceWorkerStartCaching();
                                    }
                                }

                                if (navigator.serviceWorker.controller)
                                    navigator.serviceWorker.controller.postMessage({ &apos;action&apos;: &apos;ClearCache&apos; }, [msg_chan.port2]);
                                else
                                if (Web.ServiceWorkerReg.active)
                                    Web.ServiceWorkerReg.active.postMessage({ &apos;action&apos;: &apos;ClearCache&apos; }, [msg_chan.port2]);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1389478</commentid>
    <comment_count>1</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-01-16 01:21:02 -0800</bug_when>
    <thetext>Thanks Stephan, this is a known limitation.
I will dupe it with https://bugs.webkit.org/show_bug.cgi?id=178940.
Do not hesitate to give feedback on how important it is for you.

*** This bug has been marked as a duplicate of bug 178940 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1389483</commentid>
    <comment_count>2</comment_count>
    <who name="Stephan Coertzen">coertzen.jfs</who>
    <bug_when>2018-01-16 01:29:14 -0800</bug_when>
    <thetext>Thank you. It&apos;s important for our application because we need it to be compatible with all browsers (cross platform) regarding offline support. We used applicationCache before but in future browser releases the Service Worker will replace it. Thanks for indicating that you guys are looking at supporting MessageChannel parameter passing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>