Skip to content

Instantly share code, notes, and snippets.

@calorie
Created August 28, 2022 16:55
Show Gist options
  • Save calorie/373f932dfaf4c8effc4a554073e91f35 to your computer and use it in GitHub Desktop.
Save calorie/373f932dfaf4c8effc4a554073e91f35 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Hide YouTube teaser comment
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hide YouTube teaser comment
// @author calorie
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
async function getTeaserComment() {
return new Promise((resolve) => {
const interval = setInterval(() => {
const comment = document.getElementById('comment-teaser');
if (!comment) return;
resolve(comment);
clearInterval(interval);
}, 100);
});
}
async function init() {
const comment = await getTeaserComment();
comment.style.display = 'none';
}
init();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment