2

I don't know if this is even possible but I will still ask. I have a situation where a monitor will go into sleep mode after 15minutes, I want to re activate the monitor if a dynamic content was changed. How do I reactivate the screen? Is it possible to imitate a key press or show a notification?

Thanks, Benny

  • this is not possible with javascript – DZDomi Jan 19 '18 at 23:46
  • So there is no way using a web language? – Bentipa stealth-coders Jan 19 '18 at 23:46
  • You can show a notification, but would that turn the screen back on? – SANM2009 Jan 19 '18 at 23:48
  • 2
    Leaving aside the discussion if this is possible or not: as a user, I don't want anything interfering the way I set up my machine. If I want the screen to sleep after x minutes, for instance, it should remain sleeping. From a user's perspective I'd hate a page that wakes up my screen. – Gerardo Furtado Jan 19 '18 at 23:48
  • 1
    write it in an other language which can interact with the system. – kevinSpaceyIsKeyserSöze Jan 19 '18 at 23:49
  • The requirement should be possible. Technically you could observe activity of the browser and begin a procedure which makes a system call to interrupt the monitors' sleep or hibernate mode. – guest271314 Jan 19 '18 at 23:49
  • 2
    @Gerardo yeah normally this would be not good but it's an internal project for kind of a firefighter emergency monitor. – Bentipa stealth-coders Jan 19 '18 at 23:49
  • @SANM2009 yeah that's the question – Bentipa stealth-coders Jan 19 '18 at 23:50
  • @Bentipastealth-coders Yes, that's an interesting feature, and I'm seeing you have a good reason for that... I was only trying to bring the user's perspective to the discussion. Maybe, **if** this feature is possible, you may ask the explicit user's permission before the page waking up his/her screen. – Gerardo Furtado Jan 19 '18 at 23:51
  • @kevinSpaceyIsKeyserSöze not possible, or not optimal, if there is no other way, I will write a small program in python or something like that to wakeup the monitor on request – Bentipa stealth-coders Jan 19 '18 at 23:51
  • Are you trying to alert the individual periodically? See [Alternative for checking browser idle](https://stackoverflow.com/questions/39553729/alternative-for-checking-browser-idle/) – guest271314 Jan 19 '18 at 23:51
  • https://github.com/ivanmaeder/computer-sleep this might give you some idea. You can try start playing video when content changed and stop it after few seconds. – emil Jan 19 '18 at 23:51
  • Best thing to do is to leave the monitor on all the time. This solution will always work and is easy to implement. – KIKO Software Jan 19 '18 at 23:52
  • 1
    @GerardoFurtado yeah that's right, giving it the permission should be no problem though – Bentipa stealth-coders Jan 19 '18 at 23:52
  • @KIKOSoftware not possible due to energy consumption – Bentipa stealth-coders Jan 19 '18 at 23:53
  • @emil alright I will try to – Bentipa stealth-coders Jan 19 '18 at 23:53
  • @guest271314 not really periodically, it's only shown if an emergency comes in, else it should be in sleep mode for power consumption purposes – Bentipa stealth-coders Jan 19 '18 at 23:54
  • Why would solely taking the monitor out of sleep or hibernation provide an adequate alert? That is not really an alert by itself. The alert should be not only substantial an not possible to ignore but also periodically tested (at least weekly) for first responders. – guest271314 Jan 19 '18 at 23:55
  • @guest271314 what directly are you talking about? I'm only concerned about the monitor thing itself, the fetching of emergencies is another part. – Bentipa stealth-coders Jan 19 '18 at 23:57
  • You need to fetch your service personnel first, before fetching ppe. Alert them by loud sounds. if their monitor is off when they are on call they could well be away from their office, for example, in the shop. The loud sounds should be of higher volume than power tools. At least that would be the perspective here. That is the purpose of pages and mandatory testing of alert equipment - to make sure everyone certainly gets the message. Infrequently alert messages can contain inaccurate information. There should be no question that the personnel are alerted. – guest271314 Jan 19 '18 at 23:58
  • @guest271314 I think you are misunderstanding something here :D It's a volunteer fire department in Germany, the monitor is at the department itself and should provide a small briefing for the first persons arriving ^^ – Bentipa stealth-coders Jan 20 '18 at 00:01
  • Being a volunteer first responder does not exempt one from responsibilities to the community. If that monitor is mission critical that monitor should not go into hibernation or sleep. In fact there should be at least two back up monitors onsite at all times. Why does your dept. not have enough community resources to have monitors on at all times? – guest271314 Jan 20 '18 at 00:04
  • @guest271314 that's not a requirement for the monitor and it is not that Mission critical, but thank you for remembering me about my responsibilities xD – Bentipa stealth-coders Jan 20 '18 at 00:05
  • @Bentipastealth-coders No worries. Godspeed. – guest271314 Jan 20 '18 at 00:07

1 Answers1

2

Not really, as that is an OS-specific behavior. Sending a Web API Notification may or may not turn the screen on to display the native notification message. This will depend on a matrix of OS and Browser choices, and won't be reliable. Not the mention the overhead of actually setting the notification channel up on the browser, server, managing subscriptions and clients, etc.

There are tricks to keep the screen on, though, that should work while your page is visible (active tab, in view, not minimized, etc.) Check out this library that achieves that by tricking the browser into thinking that a video is being played: https://github.com/richtr/NoSleep.js

Arash Motamedi
  • 9,284
  • 5
  • 34
  • 43
  • 1
    Please note that NoSleep.js will not work in Safari or Chrome when the user has decided to disable autoplay. The fake video can't start and keep the screen up. – Daniel Abdelsamed Jan 20 '18 at 00:09