We are looking for a way to determine whether or not each visualization is in focus or not. If for example a web visualization is not in focus (i.e. minimized) we want the program to terminate. Are there any built in methods for tracking visualization focus? or alternatively, would it be easier to write a script in another language to track if a visualization is in focus, then relay the information back to the codesys program? Other alternate solutions would be welcome as well.
Please let me know if there are any additional solutions.
If the browser doesn't tell the website it lost the focus, not much the webvisu can do?
@dgirard are you having the same use case?
for example the hasFocus() method
document.hasFocus() referes to dom nodes having a tab focus.
It does not represent the state if a website is in the foreground or not minimized.
You're right, I thought this was a method which could be used with a window. Another idea we had however was to have a signal which only triggers when a user is viewing a given visualization. If the user changes visualization, the signal stops, and another program can be executed to stop the program.
Hi @m.prestel, yes I am working on this with @jackcaissey
We are having a similar discussion in this thread with @Chris.O and @Iota: https://forge.codesys.com/forge/talk/Visualization/thread/b12815b7cd/?page=1&limit=25#6941
As far as I understand it the other thread is more focused on a watchdog feature for buttons.
I think it differs from your request to detect if a tab is invisible.
Log in to post a comment.