From 4e379b0623cebb9d92ce06f38939eb3c71b29108 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Wed, 18 Oct 2023 23:55:11 +0300 Subject: [PATCH] Added clip support to SafeTwitch https://github.com/libredirect/browser_extension/issues/833 --- src/assets/javascripts/services.js | 6 ++++++ src/config.json | 2 +- src/manifest.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 6b6cc78..6dd7356 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -522,6 +522,12 @@ function redirect(url, type, initiator, forceRedirection) { } return `${randomInstance}` } + case "safetwitch": { + if (url.hostname.startsWith("clips.")) { + return `${randomInstance}/clip${url.pathname}${url.search}` + } + return `${randomInstance}${url.pathname}${url.search}` + } default: { return `${randomInstance}${url.pathname}${url.search}` } diff --git a/src/config.json b/src/config.json index 96afcda..72cb6b8 100644 --- a/src/config.json +++ b/src/config.json @@ -182,7 +182,7 @@ } }, "targets": [ - "^https?:\\/{2}(www\\.)?twitch\\.(tv|com)\\/" + "^https?:\\/{2}(www\\.|clips\\.)?twitch\\.(tv|com)\\/" ], "name": "Twitch", "options": { diff --git a/src/manifest.json b/src/manifest.json index c4915f6..3a6e3c6 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_extensionName__", "description": "__MSG_extensionDescription__", - "version": "2.8.0", + "version": "2.8.1", "manifest_version": 2, "browser_specific_settings": { "gecko": {