Javascript - Can javascript work while the browser tab is not in focus?

I for some JavaScript code executed per second. However, it does not work if the tab to which it is loaded is not selected.

Is this my code or is Javascript unable to do this?

Also, if Javascript can run when the tab is not selected, someone can help me with the code to determine the parent tab with it, select or not.

Answers can be in pure Javascript or JQuery, and the solution should only work in IE7 +

Thanks in advance.

I am working to get the code for you. Greetings.

Seams occurred with an error in the code. Thanks for knowing that javascript will work though.

+4
source share
2 answers

Javascript should work in the background. For browsers other than Google Chrome, each tab is a stream, and the tabs should also be able to communicate with each other. For the case of chrome, since each tab is a process, you may need to use interprocess communication methods.

If you could provide your code, we would be more helpful.

+2
source

JavaScript continues to run in the background. If it does not work, there must be some other reason. It would be helpful if you could give an example of code to work and develop what cannot happen.

0
source

All Articles