feat(cc-redirect): redirect URL hash and add redundant redirect method

This CL adds logic to redirect the URL hash to the Community Console,
so actions that are embedded in the URL like |#action=reply| will be
passed to the Community Console.

It also adds another method of redirecting to the Community Console
which will coexist with the old method.

Fixed: twpowertools:164
Change-Id: Ib3f770d7cbeec8f26cdd249e66f7f46ae94bb1c8
diff --git a/src/contentScripts/publicThreadStart.js b/src/contentScripts/publicThreadStart.js
index d1c4e3c..9581aec 100644
--- a/src/contentScripts/publicThreadStart.js
+++ b/src/contentScripts/publicThreadStart.js
@@ -1,9 +1,12 @@
 import {injectStylesheet} from '../common/contentScriptsUtils.js';
-import {isOptionEnabled} from '../common/optionsUtils.js';
+import {getOptions} from '../common/optionsUtils.js';
+import {setUpRedirectIfEnabled} from '../redirect/setup.js';
 
-isOptionEnabled('uispacing').then(isUiSpacingEnabled => {
-  if (!isUiSpacingEnabled) return;
+getOptions(['uispacing', 'redirect']).then(options => {
+  if (options.uispacing) {
+    injectStylesheet(chrome.runtime.getURL('css/ui_spacing/shared.css'));
+    injectStylesheet(chrome.runtime.getURL('css/ui_spacing/twbasic.css'));
+  }
 
-  injectStylesheet(chrome.runtime.getURL('css/ui_spacing/shared.css'));
-  injectStylesheet(chrome.runtime.getURL('css/ui_spacing/twbasic.css'));
+  setUpRedirectIfEnabled(options);
 });