Greasy Fork镜像 is available in English.

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.

À partir de 2024-06-04. Voir la dernière version.

// ==UserScript==
// @name          Always Active Kick
// @namespace     https://greasyforks.org/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 });
长期地址
遇到问题?请前往 GitHub 提 Issues。