Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!