Youtube Music non-stop

Automatically clicks "Yes" when the "Video paused. Continue watching?" dialog pops up.

当前为 2025-06-19 提交的版本,查看 最新版本

// ==UserScript==
// @name           Youtube Music non-stop
// @namespace      Youtube Music non-stop
// @license        MIT
// @version        1.0.0
// @description    Automatically clicks "Yes" when the "Video paused. Continue watching?" dialog pops up.
// @grant          none
// @author         Holome-FT
// @homepage       https://gist.github.com/Holome-FT/5ba58055863702c95a9b8ffbcf719683
// @match          https://www.youtube.com/*
// @match          https://music.youtube.com/*
// ==/UserScript==

(function() {
	'use strict';

	new MutationObserver(() => {
		const popupNode = document.querySelector("ytmusic-you-there-renderer.ytmusic-popup-container");

		if (popupNode) {
			const stringNode = popupNode.querySelector("yt-formatted-string.ytmusic-you-there-renderer");

			if (stringNode && stringNode.textContent.includes("Video paused. Continue watching?")) {
				const actionNode = popupNode.querySelector("div.actions.ytmusic-you-there-renderer > yt-button-renderer.ytmusic-you-there-renderer");

				if (actionNode) {
					const buttonNode = actionNode.querySelector("button");

					if (buttonNode) buttonNode.click();
				}
			}
		}
	}).observe(document.body, { childList: true, subtree: true });
})();

QingJ © 2025

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