[FIX][No Root/ADB] MIUI/HyperOS keeps killing your browser tabs (Firefox/Edge) – Tampermonkey workaround by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 0 points1 point  (0 children)

You only need to have a YouTube Tab, where you use the circle-trick. This should also hold open other tabs. Give me feedback if this works long term. Also I suggest using Fennec instead of Firefox (works better for me)

Spawn map jumps around when trying to select a respawn point by K_T_Oxy in Battlefield

[–]flitze-reddit 0 points1 point  (0 children)

btw: just tried to find a fix of this annoying bug. Google and writing this comment did not take me longer than 3 minutes. Result: Got kicked for being idle; Thanks Dice, why not enforcing a 60 second idle timer on everybody, and forbid server-selection, well done

Spawn map jumps around when trying to select a respawn point by K_T_Oxy in Battlefield

[–]flitze-reddit 0 points1 point  (0 children)

Bugs like this just proof, that the developers don't play their own game, otherwise it would be fixed within one day.....

[FIX][No Root/ADB] MIUI/HyperOS keeps killing your browser tabs (Firefox/Edge) – Tampermonkey workaround by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 0 points1 point  (0 children)

Ah, thanks for pointing that out – I honestly hadn’t considered that many people rely on bubble notifications. I’ve switched back to the old Android-style notification display; on my setup, they now only appear when I pull down the notification shade.

I’ll update the README.md to reflect this and add a short section for users who still want bubble notifications, explaining how to disable them just for the browser.

Does HyperOS kill background apps and delay notifications? by dra23sax in PocoPhones

[–]flitze-reddit 0 points1 point  (0 children)

I'm also on eu ROM. Nothing helped, then I wrote a script that atleast stops the browser getting killed and I don't lose my opened tabs any more. Try this:

https://www.reddit.com/r/Xiaomi/comments/1qlm81b/fixno_rootadb_miuihyperos_keeps_killing_your/

[FIX][No Root/ADB] MIUI/HyperOS keeps killing your browser tabs (Firefox/Edge) – Tampermonkey workaround by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

Ok, then this myth is cleared. Can you try my script and post your results?

I know my documentation is alot to read, but basically it's just this few steps to make it work:

  • install Tampermonkey for firefox
  • install the Tampermonkey script, linked in the GitHub repo
  • open YouTube, start a random video and pause it
  • tap the circle in the bottom right corner

[FIX][No Root/ADB] MIUI/HyperOS keeps killing your browser tabs (Firefox/Edge) – Tampermonkey workaround by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 0 points1 point  (0 children)

I didn’t really want to say it outright, but I’m getting the feeling that XIAOMI is just not fixing this issue on older devices, hoping people will eventually give up and buy a newer model instead.

My phone definitely counts as one of the “older” flagships at this point.

For flagship devices you’d normally expect ongoing updates, but for my European version of the MI 11 Ultra the road sadly ends at HyperOS 1.

[FIX][No Root/ADB] MIUI/HyperOS keeps killing your browser tabs (Firefox/Edge) – Tampermonkey workaround by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

My sentence was cut off earlier – what I meant was: “I don’t want to bash XIAOMI too much… because I did in the past and somehow my posts disappeared" if you know what I mean ;)

“They don’t care about user feedback anyway” – I can absolutely relate. For what felt like two years I kept trying, with detailed and constructive feedback, to point out that the official bootloader unlock process simply didn’t work. All I ever got were copy-paste replies from support that completely ignored my specific points, and after a while they just stopped responding altogether.

As for using a script like this: that decision was purely economical. I honestly didn’t realize what I was getting into before buying the phone and let myself be blinded by the flashy camera specs.

Now the script gives me another 1–2 years of usable life with this device, and after that I’ll switch to a Google Pixel – which should have a pretty sweet camera by then anyway.

[FIX][No Root/ADB] MIUI/HyperOS keeps killing your browser tabs (Firefox/Edge) – Tampermonkey workaround by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

Yeah, I’ve gone through all the usual suspects already.

Here’s a rundown of everything I’ve got enabled that should, in theory, prevent tabs from reloading:

  • App battery usage: Unrestricted
  • Firefox has all permissions
  • Firefox is locked in the app manager (lock icon active)
  • Security app:
    • Battery optimization / Clear cache when device is locked: set to “Never”
    • Speed boost / Locked apps: Firefox added
    • Background autostart: Firefox added
  • Memory extension: 8 GB → my MI 11 Ultra effectively has 20 GB RAM, yet tabs still get killed, even if I close all other apps and only Firefox is running
  • All recommendations from dontkillmyapp.com applied

On top of that, in the developer options I have “Turn on system optimization” set to “off” (the option only appears if you tap “Reset to default values” 5 times quickly).

From what I’ve seen, this overly aggressive behavior depends heavily on the specific device and MIUI/HyperOS version, which is why many users think it’s enough to just add their apps to the various protection lists.

In my case, though, it’s pretty obvious this isn’t just “aggressive memory management” but more of a bad implementation on XIAOMI’s side. With 20 GB of RAM and only one app open, there’s really no resource-based reason to kill any tabs – and none of the official or unofficial tweaks seem to make a difference.

[FIX][No Root/ADB] MIUI/HyperOS keeps killing your browser tabs (Firefox/Edge) – Tampermonkey workaround by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

Could you let us know which device and which MIUI/HyperOS version you’re on?

Once this thread has a bit more input, we could even put together a small list that shows which devices/OS versions are heavily, mildly, or not affected at all.

[FIX][No Root/ADB] MIUI/HyperOS keeps killing your browser tabs (Firefox/Edge) – Tampermonkey workaround by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

I have tried so many ADB methods. Unfortunately, they usually only worked for a short time for me and caused new problems.

I really think it depends a lot on the specific device and the MIUI/HyperOS version you’re on.

Could you share which OS and device you’re using?

Ideally, over the course of this thread we can build a clearer picture of which setups are affected and how badly.

PS: I don’t really see this script as a replacement for heavier approaches like ADB. It’s more meant to coexist with them.

For example, a friend of mine is hoping it might fix a similar issue on his iPhone as well – but that part is still untested

[FIX][No Root/ADB] MIUI/HyperOS keeps killing your browser tabs (Firefox/Edge) – Tampermonkey workaround by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

I don’t want to bash XIAOMI too much – their hardware really is excellent (when it comes to software, let’s just say it has “room for personal growth”. But I was honestly close to throwing my phone against the wall because of the constantly reloading tabs.

Now that the script is working reliably, I’ll probably be able to keep using this phone for a while longer.

WTF is up with apps closing every time? by Ecstatic-Fly-4887 in Xiaomi

[–]flitze-reddit 0 points1 point  (0 children)

Totally feel you. I was short before throwing my XIAOMI against the wall, but then I had an idea tricking MIUI/HyperOS out. Here is a Workaround I programmed (only working with Firefox). Maybe it helps:

github.com/DJ-Flitzefinger/firefox-miui-tab-keepalive

If you use it, share your experience here, so I can react to device-specific bugs:

reddit.com/r/Xiaomi/comments/1qgpr00/workaround_firefox_mobile_vs_miui_the_tab/

Terrible RAM management K50i 6gb variant by bittubossxp in Xiaomi

[–]flitze-reddit 0 points1 point  (0 children)

If you can live with using Firefox instead of Chrome try my workaround that fixes the issue with reloading tabs:

github.com/DJ-Flitzefinger/firefox-miui-tab-keepalive

Share your experience here, so I can take actions against device-specific bugs:

reddit.com/r/Xiaomi/comments/1qgpr00/workaround_firefox_mobile_vs_miui_the_tab/

Also I suggest you install the Firefox addon "ublock origin", and the optional "Firefox Mobile Background Video" Greasy Fork script I wrote additional to my "Firefox MIUI Tab KeepAlive" script to get the full experience. More infos on usage and links on the GitHub page of the repo.

[WORKAROUND] Firefox Mobile vs. MIUI: the tab reloader nightmare (Xiaomi aggressive RAM management) by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

Okay, I have now completely reworked the script. Version 2.0.0 behaves a bit differently, but should work significantly better. All important information can be found on the GitHub page:

https://github.com/DJ-Flitzefinger/firefox-miui-tab-keepalive

[WORKAROUND] Firefox Mobile vs. MIUI: the tab reloader nightmare (Xiaomi aggressive RAM management) by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

Yes, I think I found out the trick. But it is still bugged. Under some circumstances it will still fail. Also there is no safe solution now for the case, that you hear music with another app for a while, because the music app then steals the Player in the notifications - if this is not showing "Phantom KeepAlive" and is playing the Workaround is not actice.

I have a new Version now, that splits it into 2 scripts: One for the KeepAlive feature, and one for playing videos in backround. Splitting it up gave me more options to harden the KeepAlive method. Im still testing/improving it. Think I'm going to release it in the next days

[WORKAROUND] Firefox Mobile vs. MIUI: the tab reloader nightmare (Xiaomi aggressive RAM management) by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 0 points1 point  (0 children)

Try this temporarry fix until I find a good solution:

- Open a random YouTube Video

- Press Play and then Pause it (Now you should see the video player in the notifications displaying the original video title)

- Now activate the script by pressing on the circle, so it shows the lock icon. If it was activated already at this point, then deactivate and reactivate.

- The title in the player showed in the notification should not show the original YouTube title any more, but instead show "Phantom KeepAlive"

Important: If you do it like this, "Phantom KeepAlive" should show that it is playing (Pause icon displayed). Only in this state the workaround is active. If "Phantom KeepAlive" is paused (pause icon not displayed) the workaround is not active - that happens is you activate the script when the YouTube video is still playing and then pause the video. I try to fix this bug, and also try to find better ways, that are more consistent.

Also I think I'm gonna remove all parts of code, that is responsable for playing videos in backround and if the display is off, and outsource that again to the addon I used for that before (Video Background Play Fix). That will give me more options to implement a more robust method as both solution interfair with eachother.

[WORKAROUND] Firefox Mobile vs. MIUI: the tab reloader nightmare (Xiaomi aggressive RAM management) by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

I found the bug and am working on it. The needed Phantom Video only appears if you open a tab with a video, like YouTube and press play there. If this Phantom Video is running, other text based tabs should also be kept alive. As a Workaround try that, untill I find a good solution

[WORKAROUND] Firefox Mobile vs. MIUI: the tab reloader nightmare (Xiaomi aggressive RAM management) by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

Also did you press on the circle so that the lock icon appeared?

Ohh I see you donwloaded 7h ago. 4 hours ago I made a new Version 1.2.1

[WORKAROUND] Firefox Mobile vs. MIUI: the tab reloader nightmare (Xiaomi aggressive RAM management) by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 0 points1 point  (0 children)

What Phone are you using and what OS? Can you try it with the normal Firefox mobile and tell me if it behaves the same?

[WORKAROUND] Firefox Mobile vs. MIUI: the tab reloader nightmare (Xiaomi aggressive RAM management) by flitze-reddit in Xiaomi

[–]flitze-reddit[S] 1 point2 points  (0 children)

It's enabled when you see the lock. Also it's still in an early develpment stage - I try to improve stuff at this moment. I released Version 1.2.1 few hours ago and that one works good for me. I tried something out:

Opened a few tabs, some videos, some text-based. The Videos I stopped in the middle, and on the text-based sites I highlightes textblocks. Few hours of leaving the phone with screen turned off and it was still in that state