Background data transfer and script execution. Is there a way for inactive tabs?
Such a situation: if you go from the site to another tab, then after a while chrome stops the execution of scripts and data transfer. For example, on a website, by pressing a button, data is transmitted to the server every second. if you minimize the browser or switch to another tab, after 10-20 seconds the script stops executing and the data does not leave.
Is there a way to run the script and pass the data anyway? I understand that chrome protection is triggered so as not to load the processor and the system as a whole, but maybe there is some kind of flag to disable it on a specific site or, in principle, in the entire browser?
To place the code, please use CodePen or similar tool. Thanks you!