So from what I heard this should be possible with TamperMonkey addon:

everytime I click on a YouTube video, the bar on the left (library and subscriptions) disappears (YouTube thing...).

Now the button that does this action describes as the following line (see the code in pastebin):

https://pastebin.com/TcXvqMgL

Is some kind of "automatic browser-user event" actually somehow possible with TamperMonkey?