Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save u1-liquid/97c9a7c97d1712c3f9d7e5118a6254a9 to your computer and use it in GitHub Desktop.
Save u1-liquid/97c9a7c97d1712c3f9d7e5118a6254a9 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name YouTube Live Chat Show Only Specific Author
// @namespace https://github.com/u1-liquid
// @version 1.0.0
// @description YouTubeのライブチャット上で特定ユーザー以外のメッセージを非表示
// @grant none
// @author u1-liquid
// @source https://gist.github.com/u1-liquid/97c9a7c97d1712c3f9d7e5118a6254a9
// @include https://www.youtube.com/live_chat?*
// @run-at document-idle
// @updateURL https://gist.github.com/u1-liquid/97c9a7c97d1712c3f9d7e5118a6254a9/raw/youtube-live-chat-show-only-specific-author.user.js
// @downloadURL https://gist.github.com/u1-liquid/97c9a7c97d1712c3f9d7e5118a6254a9/raw/youtube-live-chat-show-only-specific-author.user.js
// @supportURL https://gist.github.com/u1-liquid/97c9a7c97d1712c3f9d7e5118a6254a9#new_comment_field
// ==/UserScript==
(function() {
'use strict';
const observer = new MutationObserver(() => {
document.querySelectorAll('yt-live-chat-text-message-renderer').forEach(msg => {
const authorNameEl = msg.querySelector('#author-name');
if (!authorNameEl) return;
const name = authorNameEl.textContent.trim();
if (!name.includes('あわわわとーにゅ')) {
msg.style.display = 'none';
}
});
});
observer.observe(document.getElementById('items'), { childList: true, subtree: true });
})();
@u1-liquid
Copy link
Author

これなに

たまにコメントしても全然送られていないことがあるので
別垢で開いて自分の送ったメッセージが送られてるかどうか確認するためのものです

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment