Skip to content

Instantly share code, notes, and snippets.

@lucapericlp
Created December 26, 2024 10:00
Show Gist options
  • Save lucapericlp/bd920ec23dbdf46b0a70f59a584dda50 to your computer and use it in GitHub Desktop.
Save lucapericlp/bd920ec23dbdf46b0a70f59a584dda50 to your computer and use it in GitHub Desktop.

Revisions

  1. lucapericlp created this gist Dec 26, 2024.
    1 change: 1 addition & 0 deletions readwise_youtube_toggle.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    javascript:(function(){const prefix='_ytPlayerContainer_';let toggleCount=0;document.querySelectorAll('*').forEach(el=>{el.classList.forEach(cls=>{if(cls.startsWith(prefix)){el.style.display=el.style.display==='none'?%27%27:%27none%27;toggleCount++;return;}});});console.log(`Toggled display for ${toggleCount} element(s) with classes starting with "${prefix}".`);})();