I have a question about Safari running in the background on iOS and iPadOS.

I coded two demo websites as follows (both written in NextJS):

In the ondataavailable function, I periodically send a blob (once every 1 second) to my server. In the backend, I coded a POST API to upload this blob.

I noticed that with website 1, the interval doesn't work when I run Safari in the background, even on iOS and iPadOS. However, website 2 works, meaning it still calls my API normally (I tried running Safari in the background for about 1-2 hours and it worked).

So, does this mean Apple allows native APIs like MediaRecorder and its callbacks to run in the background?

I have a question about Safari running in the background on iOS and iPadOS.
 
 
Q