Is it possible to remain in full screen in mobile browser when switching app or unlocking device screen?

I made a web page that toggles full screen (using JavaScript requestFullScreen and cancelFullScreen methods) when user clicks a button. On desktop browsers, the page remains full screen when switching to other desktop applications.

However on a mobile browser, the web page exits full screen when [1] device screen is locked and user unlocks it or [2] switching to another mobile app and returning to browser app.

Using JavaScript or any equivalent, is there any way to remain in full screen on mobile devices in the above 2 scenarios until user exits the full screen manually, or is this a browser-specific feature that cannot be controlled by JS?

Appreciate some advice. Thank you!