Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

109
Vistas
Removing the comment section from the youtube video page

im trying to make a Userscript that removes the comments from the Youtube video page but cant get it to work i tried a lot of methods but keep getting different errors that lead into other errors and stuff

window.addEventListener('load', (event) => {
setTimeout(function(){
  document.document.querySelector("#comments")[0].remove()
}, 2000);
  });

i also tried this version

(function () {
    window.addEventListener('load', function () {
      setTimeout(() => {(function () {
        var CommentSection = document.querySelector("#comments");
        if (CommentSection) {
          CommentSection.parentNode.removeChild(CommentSection);
        }
      })})
    }, false);
    console.log("should be removed //")
  })()

but both give errors the hard thing is that the comments dont load immediately but load slowly and separately

thanks in advance

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Inserting a CSS rule that hides the section would be easier.

document.body.appendChild(document.createElement('style')).textContent = '.ytd-comments { display: none; }';

The .ytd-comments is the container for all the comments on a video, so setting it to display: none will hide it.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda