If you're like me you might find the Reddit sidebar to be intrusive. If your browser is less then 1000px wide then the sidebar will take up more than a third of your screen and will make the comments look squished or it will cause layout issues.

The Reddit Enhancement Suite doesn't have an option to hide the sidebar because Reddit's advertisements are often shown in the sidebar. The sidebar also has subreddit information, post information, and some handy links.

Luckily there's an easy way to hide the sidebar if you're using Chrome

First, enable the Custom JavaScript for websites Chrome extension. This extension allows you to inject custom JavaScript into websites you visit in your Chrome browser.

Then, after refreshing your browser, visit reddit.com, click on the 'cjs' icon in the top right of Chrome (the 'cjs' icon is the Custom JavaScript extension button), then copy and paste the following code into the input box:

let selector = 'div[style="max-width:100%"] > div:nth-child(2)',
    el = document.querySelector(selector),
    hidden = false

let toggleSidebar = function(e) {
    hidden = !hidden;
    let attr = hidden ? 'display:none' : '';
    el.setAttribute('style', attr);

let btn = document.createElement('button');
let style = `
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 11111111;
    background: #b5ffa3;
    opacity: 1;
    outline: none;
    border: initial;
    padding: 5px;

btn.innerText = 'toggle'
btn.setAttribute('style', style);
btn.addEventListener('click', toggleSidebar);

// toggle the sidebar so it's hidden by default

Once this code is in the Custom JavaScript extension, it will be injected into the Reddit website when you load the page.

At the bottom right of the screen is a 'toggle' button which can be used to show the sidebar again if you wish.

Because the JavaScript is injected into the page after the website loads it takes a second for the sidebar to hide, but after a couple of days of using this solution it's not very noticeable.