<?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>178940</bug_id>
          
          <creation_ts>2017-10-27 09:22:11 -0700</creation_ts>
          <short_desc>[Service Worker] Support passing MessagePort objects  to postMessage()</short_desc>
          <delta_ts>2018-02-01 09:12:07 -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>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>181178</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=174541</see_also>
          <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 name="Chris Dumez">cdumez</reporter>
          <assigned_to name="Chris Dumez">cdumez</assigned_to>
          <cc>beidson</cc>
    
    <cc>coertzen.jfs</cc>
    
    <cc>ggaren</cc>
    
    <cc>olivier</cc>
    
    <cc>thiago.soares</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1365377</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2017-10-27 09:22:11 -0700</bug_when>
    <thetext>Support passing transferables (such as MessagePort objects) to postMessage().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1365378</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-10-27 09:22:44 -0700</bug_when>
    <thetext>&lt;rdar://problem/35222245&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1389479</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-01-16 01:21:02 -0800</bug_when>
    <thetext>*** Bug 181648 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395167</commentid>
    <comment_count>3</comment_count>
    <who name="Thiago Soares">thiago.soares</who>
    <bug_when>2018-01-31 14:53:41 -0800</bug_when>
    <thetext>We have a product that uses the Service Worker Api and also need to pass MessagePort objects to postMessage().
It is a feature that will block us from using our solution on Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395172</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-01-31 14:59:54 -0800</bug_when>
    <thetext>Oh, this has actually been implemented.

*** This bug has been marked as a duplicate of bug 181178 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395203</commentid>
    <comment_count>5</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-01-31 15:48:22 -0800</bug_when>
    <thetext>(In reply to Thiago Soares from comment #3)
&gt; We have a product that uses the Service Worker Api and also need to pass
&gt; MessagePort objects to postMessage().
&gt; It is a feature that will block us from using our solution on Safari.

Thiago, do you have a public endpoint for your solution that we could use for our testing? Can you detail your usage of MessageChannel? Do you have any other requirement in terms of service worker features that Safari Tech Preview 47 would not fulfill?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395337</commentid>
    <comment_count>6</comment_count>
    <who name="Stephan Coertzen">coertzen.jfs</who>
    <bug_when>2018-01-31 21:21:55 -0800</bug_when>
    <thetext>https://mdmobile.co.za, you&apos;ll need a username and password for the update to start though. Can&apos;t you test it yourself? The issue is passing information through postMessage to the Service Worker.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395477</commentid>
    <comment_count>7</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-02-01 08:34:25 -0800</bug_when>
    <thetext>(In reply to Stephan Coertzen from comment #6)
&gt; https://mdmobile.co.za, you&apos;ll need a username and password for the update
&gt; to start though. Can&apos;t you test it yourself? The issue is passing
&gt; information through postMessage to the Service Worker.

Sure, we are testing this particular feature. It is always good to do some field testing as well :)

Also, it is a different matter if what is blocking your web site from supporting WebKit is just postMessage or if you need other stuff like pushManager, openWindow(), focus()...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395483</commentid>
    <comment_count>8</comment_count>
    <who name="Stephan Coertzen">coertzen.jfs</who>
    <bug_when>2018-02-01 08:51:12 -0800</bug_when>
    <thetext>I would think that you are implementing the service worker for all scenarios according to standard. Our App has been built to conform to standard to be supported by all browsers. https://www.w3.org/TR/service-workers-1/#dom-serviceworker-postmessage

So no, this would not be the only thing that our PWA would need.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395489</commentid>
    <comment_count>9</comment_count>
    <who name="Thiago Soares">thiago.soares</who>
    <bug_when>2018-02-01 08:59:14 -0800</bug_when>
    <thetext>(In reply to youenn fablet from comment #5)
&gt; (In reply to Thiago Soares from comment #3)
&gt; &gt; We have a product that uses the Service Worker Api and also need to pass
&gt; &gt; MessagePort objects to postMessage().
&gt; &gt; It is a feature that will block us from using our solution on Safari.
&gt; 
&gt; Thiago, do you have a public endpoint for your solution that we could use
&gt; for our testing? Can you detail your usage of MessageChannel? Do you have
&gt; any other requirement in terms of service worker features that Safari Tech
&gt; Preview 47 would not fulfill?

Hi Youenn,

We have a beta environment that I can give you access if you want. I will contact you on your email.
We use the MessageChannel to enable the service worker to directly respond to a message sent by the application:

Application code:
var messageChannel = new MessageChannel();
messageChannel.port1.onmessage = handleCommandResponse
swReg.active.postMessage(message, [messageChannel.port2]);

SW Code:
onMessage: function(event) {

}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395498</commentid>
    <comment_count>10</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-02-01 09:11:34 -0800</bug_when>
    <thetext>(In reply to Stephan Coertzen from comment #8)
&gt; I would think that you are implementing the service worker for all scenarios
&gt; according to standard. Our App has been built to conform to standard to be
&gt; supported by all browsers.
&gt; https://www.w3.org/TR/service-workers-1/#dom-serviceworker-postmessage
&gt; 
&gt; So no, this would not be the only thing that our PWA would need.

I am also interested in having a fully compliant service worker implementation. WebKit is not there yet. Current focus is on making sure fetch event, offline mode, network proxy use cases will work fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1395500</commentid>
    <comment_count>11</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-02-01 09:12:07 -0800</bug_when>
    <thetext>(In reply to Thiago Soares from comment #9)
&gt; (In reply to youenn fablet from comment #5)
&gt; &gt; (In reply to Thiago Soares from comment #3)
&gt; &gt; &gt; We have a product that uses the Service Worker Api and also need to pass
&gt; &gt; &gt; MessagePort objects to postMessage().
&gt; &gt; &gt; It is a feature that will block us from using our solution on Safari.
&gt; &gt; 
&gt; &gt; Thiago, do you have a public endpoint for your solution that we could use
&gt; &gt; for our testing? Can you detail your usage of MessageChannel? Do you have
&gt; &gt; any other requirement in terms of service worker features that Safari Tech
&gt; &gt; Preview 47 would not fulfill?
&gt; 
&gt; Hi Youenn,
&gt; 
&gt; We have a beta environment that I can give you access if you want. I will
&gt; contact you on your email.

Thanks Thiago, that would be helpful.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>