Nickersoft / push.js

The world's most versatile desktop notifications framework :earth_americas:
https://pushjs.org
MIT License
8.76k stars 546 forks source link

Notification is closing itself #216

Closed APresman closed 4 years ago

APresman commented 5 years ago

I need the notificaion to stay it open until user close it and not closing automatialy after some time.

Both requireInteraction: true and timeout: XXXXXXXX seems not to work by me (FF 56 and Chrome 75). The notification windows closes itself after about 15 seconds.

<script src="//code.jquery.com/jquery-latest.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/push.js/1.0.12/push.js"></script>
<script>
       Push.create("Hello from SIS", {
            body: event.data,
            icon: "/framework/icons/logo_mini.png",
            timeout: 1000000,
            requireInteraction: true,
            onClick: function() {
                console.log(event.data);
            }
            });

</script>

I'm not sure if FF does support requireInteraction: true . But also timeout isn't working to me.

theLufenk commented 4 years ago

Firefox doesn't support requireInteraction and yields no control over how long the notification will be visible. timeoutis an internal construct of Push.js which calls notification.close after the specified time.