Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  10 May 2023, Lukas Gerritzen, Suggestion, Desktop notifications for messages 
    Reply  10 May 2023, Stefan Ritt, Suggestion, Desktop notifications for messages 
       Reply  10 May 2023, Lukas Gerritzen, Suggestion, Desktop notifications for messages 
          Reply  11 May 2023, Stefan Ritt, Suggestion, Desktop notifications for messages 
Message ID: 2507     Entry time: 10 May 2023     Reply to this: 2510
Author: Lukas Gerritzen 
Topic: Suggestion 
Subject: Desktop notifications for messages 
It would be nice to have MIDAS notifications pop up outside of the browser window.

To get enable this myself, I hijacked the speech synthesis and I added the following to mhttpd_speak_now(text) inside mhttpd.js:
let notification = new Notification('MIDAS Message', {
    body: text,
});

I couldn't ask for the permission for notifications here, as Firefox threw the error "The Notification permission may only be requested from inside a short running user-generated event handler". Therefore, I added a button to config.html:
<button class="mbutton" onclick="Notification.requestPermission()">Request notification permission</button>

There might be a more elegant solution to request the permission.
ELOG V3.1.4-2e1708b5