<?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>282935</bug_id>
          
          <creation_ts>2024-11-11 08:58:01 -0800</creation_ts>
          <short_desc>notificationclick event not triggered if the progressive web app(pwa) is not opened</short_desc>
          <delta_ts>2024-11-18 08:58: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>Service Workers</component>
          <version>Safari 18</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 18</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>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>kakakit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>beidson</cc>
    
    <cc>nham</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2074278</commentid>
    <comment_count>0</comment_count>
    <who name="">kakakit</who>
    <bug_when>2024-11-11 08:58:01 -0800</bug_when>
    <thetext>Hello, notificationclick event cannot be triggered if the progressive web app(pwa) is already opened.
I have tried many methods including
client.focus()
clients.openWindow()
client.postMessage() message event listening
Delayed message queue (to let the client being opened)
preventDefault() in notificationclick event
Activation
event.waitUntil()
The situation is that when the device install the pwa twice, the second pwa works normally. However, it is nonsense to ask users install the pwa twice.
Is it a bug in Webkit and will it be fixed in the future? is there a workable example?
Background: using web-push, iOS 17/18
Thanks a lot</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075845</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-11-18 08:58:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/140125494&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>