User:0x08/hide-sidebar.js

var btn = $('#vector-toc button[data-event-name="pinnable-header.vector-toc.unpin"]');

if (btn.text == "hide") { btn.click; }