Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  15 Nov 2019, Andreas Suter, Suggestion, javascript comunication 
    Reply  15 Nov 2019, Stefan Ritt, Suggestion, javascript comunication 
       Reply  17 Nov 2019, Konstantin Olchanski, Suggestion, javascript comunication 
          Reply  18 Nov 2019, Stefan Ritt, Suggestion, javascript comunication 
             Reply  18 Nov 2019, Konstantin Olchanski, Suggestion, javascript comunication 
    Reply  17 Nov 2019, Konstantin Olchanski, Suggestion, javascript comunication 
       Reply  18 Nov 2019, Stefan Ritt, Suggestion, javascript comunication 
Message ID: 1741     Entry time: 18 Nov 2019     In reply to: 1739
Author: Konstantin Olchanski 
Topic: Suggestion 
Subject: javascript comunication 
> > Hi, Stefan - I did not look at your code, if all midas tabs are inactive, will the alarm sound still play?
> I added some code to do ONLY alarm updates if in the background (once every 10 seconds)

Ok, good.

> I don't have however a solution to your problem "not enough interaction with page" which I have never seen so far.

When it happens, you should see my messages about it in the javascript console. (rejected promise from audio.play()).

How to make it happen so one can see it and be sure it is handled correctly (audio.src has to be set to blank, at the least), I have no idea.

What I have been looking at for the huge memory and cpu use problem, I would call "a bad interaction between two kludges",
the first kludge is the throttling javascript in inactive tabs, the second kludge is the "not interacted" rejection of audio.play() promise.
(audio.play() returning a promise, and the strange sequencing between this promise success/reject and
the audio events loaded/canplay/done/etc smells of a kludge, too).

> I wonder if we should try push notifications: https://developers.google.com/web/fundamentals/codelabs/push-notifications
> which seems a bit complicated to me. It might also be too subtle if someone is sleeping in front of the computer.

I did not read all the explanation, but if it requires use of 3rd party services, I think we cannot use it, we do not want
to miss "experiment is on fire" alarms just because google is down.

K.O.
ELOG V3.1.4-2e1708b5