Add 'always hide CC drawer' option

When the CC starts up, it opens the drawer by default. The option
introduced by this commit closes it as soon as the content script gets
injected into the page.

Feature suggested at pekb/thread/67965396?msgid=69642485

Fixes: #10
Change-Id: I2a043dc9888eee2c9b1f98713d36cd1a49d3c931
diff --git a/src/_locales/ca/messages.json b/src/_locales/ca/messages.json
index 911bb44..6a77a77 100644
--- a/src/_locales/ca/messages.json
+++ b/src/_locales/ca/messages.json
@@ -75,6 +75,10 @@
     "message": "la configuració del mode fosc del SO",
     "description": "Select option added in #ccdarktheme_mode--container, in the options_ccdarktheme string"
   },
+  "options_ccforcehidedrawer": {
+    "message": "Amaga sempre la barra lateral de l'esquerra a la Consola de la Comunitat.",
+    "description": "Feature checkbox in the options page"
+  },
   "options_profileindicator_header": {
     "message": "Punt indicador",
     "description": "Heading for the profile indicator feature options"
diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json
index d542386..3472ee8 100644
--- a/src/_locales/en/messages.json
+++ b/src/_locales/en/messages.json
@@ -79,6 +79,10 @@
     "message": "by the OS dark mode setting",
     "description": "Select option added in #ccdarktheme_mode--container, in the options_ccdarktheme string"
   },
+  "options_ccforcehidedrawer": {
+    "message": "Always hide the drawer (left column) in the Community Console.",
+    "description": "Feature checkbox in the options page"
+  },
   "options_profileindicator_header": {
     "message": "Indicator dot",
     "description": "Heading for the profile indicator feature options"
diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json
index 00d4a60..61156c7 100644
--- a/src/_locales/es/messages.json
+++ b/src/_locales/es/messages.json
@@ -75,6 +75,10 @@
     "message": "la configuración del modo oscuro del SO",
     "description": "Select option added in #ccdarktheme_mode--container, in the options_ccdarktheme string"
   },
+  "options_ccforcehidedrawer": {
+    "message": "Esconde siempre la barra lateral izquierda en la Consola de la Comunidad.",
+    "description": "Feature checkbox in the options page"
+  },
   "options_profileindicator_header": {
     "message": "Punto indicador",
     "description": "Heading for the profile indicator feature options"
diff --git a/src/common/common.js b/src/common/common.js
index f1366b1..1a67bca 100644
--- a/src/common/common.js
+++ b/src/common/common.js
@@ -17,6 +17,7 @@
   'ccdarktheme': false,
   'ccdarktheme_mode': 'switch',
   'ccdarktheme_switch_enabled': true,
+  'ccforcehidedrawer': false,
 };
 
 const specialOptions = [
diff --git a/src/content_scripts/console_inject.js b/src/content_scripts/console_inject.js
index 6a73bdc..e435b15 100644
--- a/src/content_scripts/console_inject.js
+++ b/src/content_scripts/console_inject.js
@@ -192,4 +192,11 @@
         (parseInt(window.getComputedStyle(rightControl).width) + 58) + 'px';
     rightControl.insertAdjacentElement('afterbegin', darkThemeSwitch);
   }
+
+  if (options.ccforcehidedrawer) {
+    var drawer = document.querySelector('material-drawer');
+    if (drawer !== null && drawer.classList.contains('mat-drawer-expanded')) {
+      document.querySelector('.material-drawer-button').click();
+    }
+  }
 });
diff --git a/src/options.html b/src/options.html
index 8bb4fb2..b571a8c 100644
--- a/src/options.html
+++ b/src/options.html
@@ -21,6 +21,7 @@
         <input type="checkbox" id="increasecontrast"> <label for="increasecontrast" data-i18n="increasecontrast"></label><br>
         <input type="checkbox" id="stickysidebarheaders"> <label for="stickysidebarheaders" data-i18n="stickysidebarheaders"></label><br>
         <input type="checkbox" id="ccdarktheme"> <label for="ccdarktheme" data-i18n="ccdarktheme"></label> <span class="experimental-label" data-i18n="experimental_label"></span><br>
+        <input type="checkbox" id="ccforcehidedrawer"> <label for="ccforcehidedrawer" data-i18n="ccforcehidedrawer"></label><br>
       </p>
       <h4 data-i18n="profileindicator_header"></h4>
       <p>