about summary refs log tree commit diff stats
path: root/src/assets
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2023-07-23 21:52:45 +0300
committerManeraKai <manerakai@protonmail.com>2023-07-23 21:52:45 +0300
commit605e385b2e2e639fb1926071bec7f192b92abdde (patch)
treeb67720f66f58f205dac130fce9c291e4609e073a /src/assets
parentRemoved Import/Export Sync for Chromium https://github.com/libredirect/browse... (diff)
parent[GotHub] Remove /file/ path (diff)
downloadlibredirect-605e385b2e2e639fb1926071bec7f192b92abdde.zip
Merge branch 'gothub_gist' of https://github.com/NoPlagiarism/browser_extension into NoPlagiarism-gothub_gist
Diffstat (limited to 'src/assets')
-rw-r--r--src/assets/javascripts/services.js9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 0005770d..d76a538a 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -487,14 +487,7 @@ function redirect(url, type, initiator, forceRedirection) {
 			return
 		}
 		case "gothub": {
-			const regex = /^\/(.*)\/(.*)\/(?:blob|tree)\/(.*)\/(.*)/.exec(url.pathname)
-			if (regex) {
-				const user = regex[1]
-				const repo = regex[2]
-				const branch = regex[3]
-				const path = regex[4]
-				return `${randomInstance}/file/${user}/${repo}/${branch}/${path}`
-			}
+			if (url.hostname == "gist.github.com") return `${randomInstance}/gist${url.pathname}${url.search}`
 			return `${randomInstance}${url.pathname}${url.search}`
 		}
 		case "mikuInvidious": {