There's already "DF (Distraction Free for) YouTube", which does (almost?) the same and a bit more. Not sure if it's open source and it looks like it's not being maintained but it still works.
I really like DF Tube. And I use Youtube Blocker for regex based suggested video blocking (really useful if you are trying to take a break from one particular interest of yours).