I'm writing simple scripts to use them with tampermonkey on various sites using Firefox Nightly for Android(precisely smartphone). These scripts are working with timers, refresh page from time to time, etc, the problem is that scripts stop working when firefox is minimized, or when phone is blocked. Is there any way to force Firefox and Android to keep scripts working, to keep page working as normally but in background?
Asked
Active
Viewed 39 times
0
-
Please provide enough code so others can better understand or reproduce the problem. – Community Jun 19 '23 at 05:59
1 Answers
0
No. Android can kill any app that isn't in the foreground at any time. If you need reliability for background apps, Android is not the proper OS for you.

Gabe Sechan
- 90,003
- 9
- 87
- 127
-
what about apps like messanger etc, they are working in background. – JackStrong Jun 18 '23 at 09:05
-
@JackStrong They aren't working in the background. They register for push notifications. When one comes in, the app is run and a broadcastreceiver is called. Push messages are handled by an OS level daemon that's basically a socket waiting for data from FCM – Gabe Sechan Jun 18 '23 at 16:44