Greasy Fork

Greasy Fork is available in English.

아프리카TV 도우미

광고 숨김 & 광고 음소거 & 자동 스킵 & 자동 스크린 모드 & VOD 최고화질

当前为 2023-03-18 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         아프리카TV 도우미
// @name:ko      아프리카TV 도우미
// @namespace
// @description  광고 숨김 & 광고 음소거 & 자동 스킵 & 자동 스크린 모드 & VOD 최고화질
// @version      0.2
// @match        *://vod.afreecatv.com/player/*
// @match        *://play.afreecatv.com/*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=afreecatv.com
// @run-at       document-end
// @grant        none
// @namespace http://greasyfork.icu/users/1044223
// ==/UserScript==
(function () {
	var $ = window.jQuery;
	function waitForElement(elementPath, callBack) {
		window.setTimeout(function () {
			if ($(elementPath).length) {
				callBack(elementPath, $(elementPath));
			} else {
				waitForElement(elementPath, callBack);
			}
		}, 500);
	}
	waitForElement("button.da_area_right", function () {
		var myInterval = setInterval(function () {
			if ($("button.da_area_right").is(":visible")) {
				if (isNaN(Number($("button.da_area_right").find("em")[0].innerText))) {
					$("button.da_area_right").click();
					setTimeout(function () {
						if ($("#btn_sound").hasClass("mute")) {
							$("#btn_sound").click();
							$(".btn_smode").click();
							$(".thumb").remove();
						}
					}, 500);
					clearInterval(myInterval);
				} else if (!$("#btn_sound").hasClass("mute")) {
					$("#btn_sound").click();
					$(".da_video");
				}
			}
			if ($(".btn_smode").find("span")[0].innerText !== "스크린모드 종료(S)") {
				$(".btn_smode").click();
			}
		}, 500);
	});
	if (window.location.hostname == "vod.afreecatv.com") {
		waitForElement("#afreecatv_player", function () {
			$('button[name="play"]').each(function () {
				$(this).click();
			});
			$("span.bg").each(function () {
				$(this).click();
			});
		});
		waitForElement("#quality_levels > li:nth-child(2) > button", function () {
			setTimeout(function () {
				$("#quality_levels > li:nth-child(2) > button").click();
			}, 500);
		});
	}
	$("#header_ad").remove();
})();