Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Bug Reports
  3. Is Safari intentionally excluded from the Service Worker installation?

Is Safari intentionally excluded from the Service Worker installation?

Scheduled Pinned Locked Moved Bug Reports
28 Posts 4 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • AMAARETSA This user is from outside of this forum
    AMAARETSA This user is from outside of this forum
    AMAARETS
    wrote on last edited by
    #1

    I saw that there is an exception for the Safari browser that the Service Worker is not installed, is there a reason for this?

    https://github.com/NodeBB/NodeBB/blob/b1e4248b56f4b9fe4b1cef778debd94333445c6e/public/src/app.js#L355

    This makes it impossible to subscribe to push notifications in the Safari browser even when installing the page as a PWA application

    <baris>B ? 11 Replies Last reply
    0
    • AMAARETSA AMAARETS

      I saw that there is an exception for the Safari browser that the Service Worker is not installed, is there a reason for this?

      https://github.com/NodeBB/NodeBB/blob/b1e4248b56f4b9fe4b1cef778debd94333445c6e/public/src/app.js#L355

      This makes it impossible to subscribe to push notifications in the Safari browser even when installing the page as a PWA application

      <baris>B This user is from outside of this forum
      <baris>B This user is from outside of this forum
      <baris>
      wrote on last edited by
      #2

      Probably safari didn't support service workers when this code was added.

      AMAARETSA ? 2 Replies Last reply
      0
      • <baris>B <baris>

        Probably safari didn't support service workers when this code was added.

        AMAARETSA This user is from outside of this forum
        AMAARETSA This user is from outside of this forum
        AMAARETS
        wrote on last edited by
        #3

        > @baris said:
        >
        > Probably safari didn't support service workers when this code was added.

        So, would it be possible to revert Safari to a standard Service Worker installation today?
        It may still only support it when the page is installed as a PWA, so you need to implement exception handling by checking something like this:

        if (!('serviceWorker' in navigator)) {
            return;
        }
        
        1 Reply Last reply
        0
        • <baris>B <baris>

          Probably safari didn't support service workers when this code was added.

          ? Offline
          ? Offline
          Guest
          wrote on last edited by
          #4

          @baris As an iPhone user with Safari, I would really like to see this fixed.
          @AMAARETS' solution seems great to me, and I would be happy if they would fix it officially.

          1 Reply Last reply
          0
          • AMAARETSA AMAARETS

            I saw that there is an exception for the Safari browser that the Service Worker is not installed, is there a reason for this?

            https://github.com/NodeBB/NodeBB/blob/b1e4248b56f4b9fe4b1cef778debd94333445c6e/public/src/app.js#L355

            This makes it impossible to subscribe to push notifications in the Safari browser even when installing the page as a PWA application

            <baris>B This user is from outside of this forum
            <baris>B This user is from outside of this forum
            <baris>
            wrote on last edited by
            #5

            If someone with safari can confirm it works when !config.useragent.isSafari is removed, we can make that change.

            ? 1 Reply Last reply
            0
            • <baris>B <baris>

              If someone with safari can confirm it works when !config.useragent.isSafari is removed, we can make that change.

              ? Offline
              ? Offline
              Guest
              wrote on last edited by
              #6

              > @baris said:
              >
              > If someone with safari can confirm it works when !config.useragent.isSafari is removed, we can make that change.

              I tested it, and indeed it helped.. so you can make this change..
              Only there is a very annoying bug

              If my friend sends me three private messages in a row, whose content is "Message 1" "Message 2" "Message 3" I would receive three notifications with the following content: "Message 1" "Message 1" "Message 1"
              Which means I would receive the same content of the first message in the three notifications...

              Did you understand the problem and can you fix it?

              It seems to me that this happens because when sending several messages in a row, the message ID is not the same, and then it takes the content from the first message.

              1 Reply Last reply
              0
              • AMAARETSA AMAARETS

                I saw that there is an exception for the Safari browser that the Service Worker is not installed, is there a reason for this?

                https://github.com/NodeBB/NodeBB/blob/b1e4248b56f4b9fe4b1cef778debd94333445c6e/public/src/app.js#L355

                This makes it impossible to subscribe to push notifications in the Safari browser even when installing the page as a PWA application

                <baris>B This user is from outside of this forum
                <baris>B This user is from outside of this forum
                <baris>
                wrote on last edited by
                #7

                I think that might be just the notification merging that happens in core, not something related to service worker.

                ? 1 Reply Last reply
                0
                • <baris>B <baris>

                  I think that might be just the notification merging that happens in core, not something related to service worker.

                  ? Offline
                  ? Offline
                  Guest
                  wrote on last edited by
                  #8

                  > @baris said:
                  >
                  > I think that might be just the notification merging that happens in core, not something related to service worker.

                  So can you fix this please?

                  1 Reply Last reply
                  0
                  • AMAARETSA AMAARETS

                    I saw that there is an exception for the Safari browser that the Service Worker is not installed, is there a reason for this?

                    https://github.com/NodeBB/NodeBB/blob/b1e4248b56f4b9fe4b1cef778debd94333445c6e/public/src/app.js#L355

                    This makes it impossible to subscribe to push notifications in the Safari browser even when installing the page as a PWA application

                    <baris>B This user is from outside of this forum
                    <baris>B This user is from outside of this forum
                    <baris>
                    wrote on last edited by
                    #9

                    @שניאור-שמח can you share a screenshot of the issue you are seeing, is it the notification in nodebb or the email notification?

                    ? 1 Reply Last reply
                    0
                    • <baris>B <baris>

                      @שניאור-שמח can you share a screenshot of the issue you are seeing, is it the notification in nodebb or the email notification?

                      ? Offline
                      ? Offline
                      Guest
                      wrote on last edited by
                      #10

                      @baris Here you can see that in all notifications you see the same content of message number 1.
                      IMG_6603.jpeg

                      IMG_6604.jpeg

                      1 Reply Last reply
                      0
                      • AMAARETSA AMAARETS

                        I saw that there is an exception for the Safari browser that the Service Worker is not installed, is there a reason for this?

                        https://github.com/NodeBB/NodeBB/blob/b1e4248b56f4b9fe4b1cef778debd94333445c6e/public/src/app.js#L355

                        This makes it impossible to subscribe to push notifications in the Safari browser even when installing the page as a PWA application

                        <baris>B This user is from outside of this forum
                        <baris>B This user is from outside of this forum
                        <baris>
                        wrote on last edited by
                        #11

                        These are push notifications so they are likely handled in the web-push plugin, I see a PR there https://github.com/NodeBB/nodebb-plugin-web-push/pull/64 that might fix this issue @julian

                        ? 1 Reply Last reply
                        0
                        • <baris>B <baris>

                          These are push notifications so they are likely handled in the web-push plugin, I see a PR there https://github.com/NodeBB/nodebb-plugin-web-push/pull/64 that might fix this issue @julian

                          ? Offline
                          ? Offline
                          Guest
                          wrote on last edited by
                          #12

                          @baris That's right, that's what I have installed, but it only helped the notifications appear on the iPhone in the Safari browser, but it still didn't help with the notification merging problem.

                          So I ask you to try to sort this out.
                          thanks.

                          julianJ 1 Reply Last reply
                          0
                          • ? Guest

                            @baris That's right, that's what I have installed, but it only helped the notifications appear on the iPhone in the Safari browser, but it still didn't help with the notification merging problem.

                            So I ask you to try to sort this out.
                            thanks.

                            julianJ This user is from outside of this forum
                            julianJ This user is from outside of this forum
                            julian
                            wrote on last edited by
                            #13

                            @שניאור-שמח are chats the only type of notification failing at merging?

                            @baris web push is a direct reflection of regular notifications so if they share merge id, the old push notif is removed and replaced

                            1 Reply Last reply
                            0
                            • AMAARETSA AMAARETS

                              I saw that there is an exception for the Safari browser that the Service Worker is not installed, is there a reason for this?

                              https://github.com/NodeBB/NodeBB/blob/b1e4248b56f4b9fe4b1cef778debd94333445c6e/public/src/app.js#L355

                              This makes it impossible to subscribe to push notifications in the Safari browser even when installing the page as a PWA application

                              <baris>B This user is from outside of this forum
                              <baris>B This user is from outside of this forum
                              <baris>
                              wrote on last edited by
                              #14

                              @julian seems like safari is picky about replacing same notifs with tag, the PR on the repo has some code to handle safari via mergeId.

                              00dd43ab-466c-4a37-baf1-3db217eae9c5-image.jpeg

                              ? AMAARETSA 2 Replies Last reply
                              0
                              • ? Offline
                                ? Offline
                                Guest
                                wrote on last edited by
                                #15

                                > @julian said:
                                >
                                > are chats the only type of notification failing at merging?

                                Yes, the problem is only with private messages, where several messages are sent in a row.

                                1 Reply Last reply
                                0
                                • <baris>B <baris>

                                  @julian seems like safari is picky about replacing same notifs with tag, the PR on the repo has some code to handle safari via mergeId.

                                  00dd43ab-466c-4a37-baf1-3db217eae9c5-image.jpeg

                                  ? Offline
                                  ? Offline
                                  Guest
                                  wrote on last edited by
                                  #16

                                  > @baris said:
                                  >
                                  > the PR on the repo has some code to handle safari via mergeId.
                                  >
                                  >

                                  My friend @AMAARETS is the one who did what I asked him to do.
                                  But it still didn't help the problem.

                                  1 Reply Last reply
                                  0
                                  • AMAARETSA AMAARETS

                                    I saw that there is an exception for the Safari browser that the Service Worker is not installed, is there a reason for this?

                                    https://github.com/NodeBB/NodeBB/blob/b1e4248b56f4b9fe4b1cef778debd94333445c6e/public/src/app.js#L355

                                    This makes it impossible to subscribe to push notifications in the Safari browser even when installing the page as a PWA application

                                    <baris>B This user is from outside of this forum
                                    <baris>B This user is from outside of this forum
                                    <baris>
                                    wrote on last edited by
                                    #17

                                    The code in that pull request isn't merged yet, so it is not active in the latest version of nodebb. Once it's merged and published you can install and test it. Or you can replace the plugin with your own version for testing.

                                    ? 1 Reply Last reply
                                    0
                                    • <baris>B <baris>

                                      The code in that pull request isn't merged yet, so it is not active in the latest version of nodebb. Once it's merged and published you can install and test it. Or you can replace the plugin with your own version for testing.

                                      ? Offline
                                      ? Offline
                                      Guest
                                      wrote on last edited by
                                      #18

                                      @baris This is what I did, I installed the plugin with the changes and it still didn't help..
                                      What I'm trying to explain is that the change my friend made for message merging didn't help the problem..
                                      So I would appreciate it if you could see what the problem is and fix it..
                                      Thank you

                                      1 Reply Last reply
                                      0
                                      • AMAARETSA AMAARETS

                                        I saw that there is an exception for the Safari browser that the Service Worker is not installed, is there a reason for this?

                                        https://github.com/NodeBB/NodeBB/blob/b1e4248b56f4b9fe4b1cef778debd94333445c6e/public/src/app.js#L355

                                        This makes it impossible to subscribe to push notifications in the Safari browser even when installing the page as a PWA application

                                        <baris>B This user is from outside of this forum
                                        <baris>B This user is from outside of this forum
                                        <baris>
                                        wrote on last edited by
                                        #19

                                        @שניאור-שמח unfortunately I don't have an iphone so I can't test the changes.

                                        ? 1 Reply Last reply
                                        0
                                        • <baris>B <baris>

                                          @שניאור-שמח unfortunately I don't have an iphone so I can't test the changes.

                                          ? Offline
                                          ? Offline
                                          Guest
                                          wrote on last edited by
                                          #20

                                          @baris I have an iPhone, I'll check what's needed, but you guys do what's needed to fix the bug and I'll check if it worked or not..
                                          I just don't understand the system very well, and I wasn't able to fix the problem on my own..

                                          1 Reply Last reply
                                          0

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better 💗

                                          Register Login
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          Powered by NodeBB Contributors
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups