From 1b95b1ce527cda1812caaa68da4c55a61092a471 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 28 Jan 2024 16:52:03 +0300 Subject: [PATCH] Added raw.githubusercontent.co support for GotHub https://github.com/libredirect/browser_extension/issues/890 --- src/assets/javascripts/services.js | 1 + src/config.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 3aba28d..e1013c0 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -419,6 +419,7 @@ function redirect(url, type, initiator, forceRedirection, incognito) { } case "gothub": { if (url.hostname == "gist.github.com") return `${randomInstance}/gist${url.pathname}${url.search}` + if (url.hostname == "raw.githubusercontent.com") return `${randomInstance}/raw${url.pathname}${url.search}` return `${randomInstance}${url.pathname}${url.search}` } case "mikuInvidious": { diff --git a/src/config.json b/src/config.json index 4029d53..567fcb1 100644 --- a/src/config.json +++ b/src/config.json @@ -637,7 +637,8 @@ }, "targets": [ "^https?:\\/{2}github\\.com\\/", - "^https?:\\/{2}gist\\.github\\.com\\/[^\\/]+\\/[^\\/]+\\/?" + "^https?:\\/{2}gist\\.github\\.com\\/[^\\/]+\\/[^\\/]+\\/?", + "^https?:\\/{2}raw\\.githubusercontent\\.com\\/[^\\/]+\\/[^\\/]+\\/?" ], "name": "GitHub", "options": {