Skip to content

Instantly share code, notes, and snippets.

@michaelrhodes
Last active August 31, 2020 09:25
Show Gist options
  • Save michaelrhodes/112433780797cf45e794d5ffe34b14d5 to your computer and use it in GitHub Desktop.
Save michaelrhodes/112433780797cf45e794d5ffe34b14d5 to your computer and use it in GitHub Desktop.
load youtube videos in distraction-free embedded views
javascript:(function(h,r){l(h)||(onclick=function(e,a){onclick=null;(a=e.target.closest('a'))&&l(a.href)});function%20l(h,i){(i=h&&r.test(h)&&h.replace(r,'$3'))&&(location.href='https://youtube.com/embed/'+i+'?modestbranding=1&iv_load_policy=3')}})(location.href,/^https:\/\/(www\.)?youtu(.be\/|be.com\/watch\?v=)([^\/&#\?]+).*$/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment