fix(cc-redirect): redirect community guides and videos
Fixed: twpowertools:179
Change-Id: Id4318084100d7a464e82bba47b8085ed7ffd07ea
diff --git a/src/contentScripts/publicGuide.js b/src/contentScripts/publicGuide.js
new file mode 100644
index 0000000..fa2f47b
--- /dev/null
+++ b/src/contentScripts/publicGuide.js
@@ -0,0 +1,3 @@
+import {redirectIfApplicable} from '../redirect/index.js';
+
+redirectIfApplicable();
diff --git a/src/contentScripts/publicGuideStart.js b/src/contentScripts/publicGuideStart.js
new file mode 100644
index 0000000..c6571b0
--- /dev/null
+++ b/src/contentScripts/publicGuideStart.js
@@ -0,0 +1,3 @@
+import { setUpRedirectIfEnabled } from "../redirect/setup";
+
+setUpRedirectIfEnabled();
diff --git a/templates/manifest.gjson b/templates/manifest.gjson
index 76404ba..f7b2923 100644
--- a/templates/manifest.gjson
+++ b/templates/manifest.gjson
@@ -43,6 +43,18 @@
"run_at": "document_end"
},
{
+ "matches": ["https://support.google.com/*/community-guide/*", "https://support.google.com/*/community-video/*"],
+ "exclude_matches": ["https://support.google.com/s/community*"],
+ "js": ["publicGuideStart.bundle.js"],
+ "run_at": "document_start"
+ },
+ {
+ "matches": ["https://support.google.com/*/community-guide/*", "https://support.google.com/*/community-video/*"],
+ "exclude_matches": ["https://support.google.com/s/community*"],
+ "js": ["publicGuide.bundle.js"],
+ "run_at": "document_end"
+ },
+ {
"matches": ["https://support.google.com/s/community*", "https://support.google.com/*/thread/*"],
"exclude_matches": ["https://support.google.com/*/thread/new*"],
"js": ["profileIndicator.bundle.js"]
diff --git a/webpack.config.js b/webpack.config.js
index 36e8305..0254055 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -45,6 +45,8 @@
publicForum: './src/contentScripts/publicForum.js',
publicThread: './src/contentScripts/publicThread.js',
publicThreadStart: './src/contentScripts/publicThreadStart.js',
+ publicGuide: './src/contentScripts/publicGuide.js',
+ publicGuideStart: './src/contentScripts/publicGuideStart.js',
publicProfile: './src/contentScripts/publicProfile.js',
publicProfileStart: './src/contentScripts/publicProfileStart.js',
profileIndicator: './src/contentScripts/profileIndicator.js',