Twitch Status+

Switch to online and share activity status on page load™.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Twitch Status+
// @namespace    https://github.com/kittenparry/
// @version      0.1
// @description  Switch to online and share activity status on page load™.
// @author       kittenparry
// @match        https://*.twitch.tv/*
// @grant        none
// @license      GPL-3.0-or-later
// ==/UserScript==

setTimeout(() => {
	let avatar = document.querySelector('img[class="tw-block tw-border-radius-rounded tw-image tw-image-avatar"]');
	avatar.click();
	let online_toggle = document.querySelectorAll('input[class="ScToggleInput-sc-796zbf-1 doVmsZ tw-toggle__input"]')[0];
	if (!online_toggle.checked) {
		online_toggle.click();
		let activity_toggle = document.querySelectorAll('input[class="ScToggleInput-sc-796zbf-1 doVmsZ tw-toggle__input"]')[1];
		if (!activity_toggle.checked) {
			activity_toggle.click();
		}
		avatar.click();
	} else {
		avatar.click();
	}
}, 3000);