<?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>247315</bug_id>
          
          <creation_ts>2022-11-01 06:43:30 -0700</creation_ts>
          <short_desc>`&apos;Notification&apos; in window` returns false</short_desc>
          <delta_ts>2024-02-04 11:35:57 -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>DOM</component>
          <version>Safari 16</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 16</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=264074</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="N">hendrex.jakai</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>ashvayka</cc>
    
    <cc>bedney</cc>
    
    <cc>beidson</cc>
    
    <cc>cdumez</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1909539</commentid>
    <comment_count>0</comment_count>
    <who name="N">hendrex.jakai</who>
    <bug_when>2022-11-01 06:43:30 -0700</bug_when>
    <thetext>Hey
I have iOS 16.2 installed on my iPhone, and I have enabled under Safari&apos;s experimental WebKit features:

- Built-in Web Notifications
- Push API
- Permissions API

However, while `&apos;PushManager&apos; in window` returns true, `&apos;Notification&apos; in window` returns false, so I can&apos;t use the very basic `Notification.permission` so I can handle the modals and requests properly.

Do you know if it will be the case that Safari won&apos;t be supporting such basic and important thing as `Notification.permission` ?

Thank you!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1909613</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-11-01 12:49:57 -0700</bug_when>
    <thetext>Notification.permission is certainly supported, and exposed as window.Notification.permission. CC&apos;ing some folks who would know why the &quot;in window&quot; check fails.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1909639</commentid>
    <comment_count>2</comment_count>
    <who name="N">hendrex.jakai</who>
    <bug_when>2022-11-01 14:54:24 -0700</bug_when>
    <thetext>Thanks Alexey.

I&apos;ve just tested &quot;window.Notification&quot;, and it seems to be &quot;undefined&quot;.

I double checked, and I have those same 3 feature flags (listed in my previous comment) enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910165</commentid>
    <comment_count>3</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2022-11-03 13:19:45 -0700</bug_when>
    <thetext>No matter what you&apos;ve done with those experimental feature flags, window.Notification is not supported in Safari on iOS 16.

As for your questions of when Safari will support a particular feature; Safari is a product shipped by Apple, not the WebKit open source project.

So this is not a place where that can be answered.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910168</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-11-03 13:26:08 -0700</bug_when>
    <thetext>I tested wrong. First, I tested on macOS. Second, I tried `Notification in window` instead of `&apos;Notification&apos; in window`. Embarrassing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910179</commentid>
    <comment_count>5</comment_count>
    <who name="N">hendrex.jakai</who>
    <bug_when>2022-11-03 14:30:57 -0700</bug_when>
    <thetext>Thanks Brady.

Could you please indicate where can I report this and get answers about this?

This looks like a significant hole on the implementation of Web Push, as we need to know the value of `Notification.permission` to be able to optimize the user&apos;s experience on the website.

(and avoid annoying the user, or provide the user with instructions to unblock the notifications if they are trying to turn these on again, etc)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911008</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-08 05:44:19 -0800</bug_when>
    <thetext>&lt;rdar://problem/102087326&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1957468</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2023-05-23 15:54:57 -0700</bug_when>
    <thetext>(In reply to N from comment #5)
&gt; Thanks Brady.
&gt; 
&gt; Could you please indicate where can I report this and get answers about this?
&gt; 
&gt; This looks like a significant hole on the implementation of Web Push, as we
&gt; need to know the value of `Notification.permission` to be able to optimize
&gt; the user&apos;s experience on the website.
&gt; 
&gt; (and avoid annoying the user, or provide the user with instructions to
&gt; unblock the notifications if they are trying to turn these on again, etc)

Can you use navigator.permissions for that?

There&apos;s a code snippet here:
https://webkit.org/blog/14112/badging-for-home-screen-web-apps/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010505</commentid>
    <comment_count>8</comment_count>
    <who name="William J. Edney">bedney</who>
    <bug_when>2024-02-04 11:35:57 -0800</bug_when>
    <thetext>In case anyone else happens upon this bug, in Safari for iOS (at least as of iOS 17.3), the Notification object is undefined (i.e. &quot;&apos;Notification&apos; in window&quot; will fail) *unless the page is &quot;installed&quot;* (i.e. it is running as a PWA / has been &quot;Add(ed) To Home Screen&quot;).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>