Yunux-AlwaysActive: How One Chrome Extension Teaches the Browser to Lie About Being Idle

A deep dive into visibility spoofing, audio-based throttling avoidance, and the uneasy power of enterprise policy installs.

8 to 10 min read View on GitHub More from itsyunus

A browser tab presented like a stage prop, with one hand swapping a visible nameplate while another jams a wedge into the browser's visibility sensor. A faint metronome and waveform keep running in the background. The scene explains the article's core claim: this extension does not merely keep a session alive, it falsifies the signals that say whether it is alive at all.
The extension works by rewriting the browser's evidence about user attention, not by simply simulating mouse movement.
Key Takeaways

The unsettling part of Yunux-AlwaysActive is not that it keeps a browser tab awake. It is that it treats browser inactivity as a story the extension can rewrite. The page is nudged to believe the tab is visible, focused, and unthreatened, while the browser is nudged to keep running code that should have gone quiet.

The browser thinks the tab is alive

That is the whole game. If a site decides whether you are present by checking visibility, focus, or timing behavior, then the extension tries to corrupt those checks before they reach the application. It is less an alarm clock and more a forged badge at the door.

The extension survives by moving from the isolated extension world into the page's main world, where the real browser signals can be patched.

Three layers of deception

The repo's anti-detection logic is blunt in the best possible way. First, it rewrites visibility state with Object.defineProperty. Then it suppresses events with stopImmediatePropagation(). Finally, it spoofs fullscreen checks so page code gets the answer it expects, not the truth.

Object.defineProperty(document, 'hidden', {
  get: () => false,
  configurable: true
});

Object.defineProperty(document, 'visibilityState', {
  get: () => 'visible',
  configurable: true
});

document.addEventListener('visibilitychange', (e) => {
  e.stopImmediatePropagation();
}, true);

This is not subtle engineering in the sense of elegance. It is subtle in the sense that it targets the exact places many apps trust first. A dashboard, a proctoring script, or an internal portal can only respond to the signals it sees. Yunux-AlwaysActive spends its effort making those signals unreliable.

Why the tab still runs when it should slow down

A close-up of a silent audio circuit feeding a browser timer. The waveform is tiny and nearly flat, but it keeps a metronome alive while the rest of the tab sleeps around it. The image explains how audio activity can keep background work from being aggressively throttled.
A near-silent AudioContext can buy the tab enough attention from Chrome to keep scripts moving.

The point is not volume. It is exemption. Browsers are much more willing to deprioritize a quiet background tab than one that appears to be playing audio. This repo uses that rule as a loophole, keeping its own machinery warm enough to continue lying.

Why the injector exists at all

The hardest boundary in the project is not the browser. It is the split between extension code and page code. Content scripts can observe the page, but they do not always get to rewrite the page's own globals. That is why injector.js inserts a script element into the DOM and lets inject.js run in the main world.

const script = document.createElement('script');
script.src = chrome.runtime.getURL('inject.js');
(document.head || document.documentElement).appendChild(script);
script.remove();

That is the architectural hinge. Once the code lands in the main world, it can patch page-visible APIs instead of merely watching them. The repo even goes after timing logic, including performance.now(), which matters because some sites watch for the telltale gaps that appear when a tab is suspended.

Enterprise policy turns a utility into a hard-to-remove install

The deployment scripts are the most revealing files in the repository because they change the product story. A normal extension can be installed, disabled, and removed by the user. A policy-backed extension looks different: Chrome presents it as installed by enterprise policy, which makes it feel less like a plugin and more like infrastructure.

DimensionStandard keep-awake toolsYunux-AlwaysActive
ScopeOperating system sleep behaviorBrowser tab state and page trust signals
What it foolsSleep timers and idle inhibitionVisibility checks, focus events, throttling, and fullscreen checks
PersistenceUser-installed utility or tray appEnterprise policy install that is harder to remove
DetectabilityUsually obvious in system UICan look like an ordinary active tab unless inspected closely
User controlEasy to toggle on and offMore resistant to casual removal once policy-installed

That difference is why the repo feels more adversarial than a typical keep-awake tool. It is not just asking for permission to stay awake. It is trying to make removal, observation, and even suspicion harder than they should be.

What this repo reveals about idle detection

The broader lesson is uncomfortable. Idle detection is not a single switch. It is a pile of assumptions about visibility, event delivery, timing, and user intent. If an extension can spoof enough of those assumptions, then the system stops being a reliable judge of presence and becomes another client-side negotiation.

QuestionWhat many apps assumeWhat this repo shows
Is the tab visible?The browser tells the truthThe extension can redefine the answer
Did the user leave?Blur and visibility events will fire cleanlyThose events can be intercepted or suppressed
Can the page run normally in the background?Background work will slow down predictablyAudio activity can keep the tab scheduled more aggressively
Can a user remove the tool easily?Yes, through normal extension controlsNot if enterprise policy is used for installation

That matters for builders of dashboards, remote workflows, and admin portals. If your product depends on client-side inactivity checks, you are trusting a layer that this repo demonstrates how to tamper with. The answer is not to panic. It is to stop treating browser state as a security boundary.