Always Active Kick

Keeps Kick tab as always active even when in background tabs. This allows you to keep favorite streamer page open in background tab and it willl automatically start playing when live.

目前為 2024-06-04 提交的版本,檢視 最新版本

// ==UserScript==
// @name          Always Active Kick
// @namespace     https://gf.qytechs.cn/en/users/1200587-trilla-g
// @match       *://*.kick.com/*
// @description   Keeps Kick tab as always active even when in background tabs. This allows you to keep favorite streamer page open in background tab and it willl automatically start playing when live.
// @version        2.0
// @license         MIT
// @author          Trilla_G
// ==/UserScript==

// Prevent the page from being hidden
document.addEventListener('visibilitychange', function() {
    if (document.hidden) {
        document.hidden = false;
        document.visibilityState = 'visible';
        // Dispatch a visibilitychange event to simulate a visibility update
        var event = new Event('visibilitychange');
        document.dispatchEvent(event);
    }
});

// Keep the page in focus by listening to blur and focus events
window.addEventListener('blur', function() {
    window.setTimeout(function() {
        window.focus();
    }, 0);
});

// Try to set the document's visibilityState directly
Object.defineProperty(document, 'hidden', { value: false, writable: false });
Object.defineProperty(document, 'visibilityState', { value: 'visible', writable: false });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址