Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
Bookmarklet to turn on Dark Theme on Youtube

Sorry for posting an unsophisticated question.

I'd like to use Youtube with Dark Mode always on, but sometimes the configurations are reset and I have to click the icon button, Appearance and then Dark theme.
I hope there could be a bookmarklet for this procedure.
And I guess it's not so complicated, only if I had a bit of knowledge.

According to my imagination, the code should look like blow. How could it be improved? With what search phrase could I find information?

javascript:(function()<br>
{document.getElementById("[ID of Account Menu]").click();}<br>
{document.getElementById("[ID of Appearance]".click();}<br>
{document.getElementById("[ID of Dark theme]".click();}<br>
)();

Thanks.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Note: the bookmarklet seems to not do the job if the time is too short so play with the timeouts

javascript: (() => {
  document.getElementById("avatar-btn").click();
  setTimeout(() => {
    document.querySelector(".ytd-toggle-theme-compact-link-renderer").click();
    setTimeout(() => {
      document.querySelectorAll(".ytd-compact-link-renderer").forEach(yt => {
        if (yt.textContent === "Dark theme") yt.click();
      });
    }, 1000)
  }, 1000)
})()

That said, there is a "Use device theme" you might want to use instead

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda