diff options
author | NoPlagiarism <37241775+NoPlagiarism@users.noreply.github.com> | 2023-07-15 18:49:17 +0500 |
---|---|---|
committer | NoPlagiarism <37241775+NoPlagiarism@users.noreply.github.com> | 2023-07-16 23:49:27 +0500 |
commit | b1eec4f2755d3396f1d9181d33d5739563005d43 (patch) | |
tree | 9f3e53d6713ed4b24cd37c127a9b96eab31b361d | |
parent | Added WTF IS MY IP! https://github.com/libredirect/browser_extension/issues/746 (diff) | |
download | libredirect-b1eec4f2755d3396f1d9181d33d5739563005d43.zip |
[GotHub] Add GitHub gists support
-rw-r--r-- | src/assets/javascripts/services.js | 1 | ||||
-rw-r--r-- | src/config.json | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index d0d85acd..dd8ea7ac 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -501,6 +501,7 @@ function redirect(url, type, initiator, forceRedirection) { 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": { diff --git a/src/config.json b/src/config.json index 36d8b86f..6e97b26e 100644 --- a/src/config.json +++ b/src/config.json @@ -708,7 +708,8 @@ } }, "targets": [ - "^https?:\\/{2}github\\.com\\/" + "^https?:\\/{2}github\\.com\\/", + "^https?:\\/{2}gist.github\\.com\\/[^\\/]+\\/[^\\/]+\\/?" ], "name": "GitHub", "options": { @@ -886,4 +887,4 @@ "url": "https://www.wolframalpha.com" } } -} \ No newline at end of file +} |