From ecdb4466ef94480c77c693e2853e97a85e57c396 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Wed, 31 May 2023 21:00:30 +0300 Subject: [PATCH] Added Laboratory https://github.com/libredirect/browser_extension/issues/723 --- src/assets/images/gitlab-icon.svg | 1 + src/assets/javascripts/services.js | 6 ++++++ src/config.json | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 src/assets/images/gitlab-icon.svg diff --git a/src/assets/images/gitlab-icon.svg b/src/assets/images/gitlab-icon.svg new file mode 100644 index 00000000..2c218a2b --- /dev/null +++ b/src/assets/images/gitlab-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 0da2bfa5..a5e6a965 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -547,6 +547,11 @@ function redirect(url, type, initiator, forceRedirection) { if (url.hostname == "i.pinimg.com") return `${randomInstance}/image_proxy.php?url=${url.href}` return randomInstance } + case "laboratory": { + let path = url.pathname + if (path == "/") path = "" + return `${randomInstance}/${url.hostname}${path}${url.search}` + } default: { return `${randomInstance}${url.pathname}${url.search}` } @@ -684,6 +689,7 @@ const defaultInstances = { 'mikuInvidious': ['https://mikuinv.resrv.org'], "tent": ['https://tent.sny.sh'], "wolfreeAlpha": ['https://gqq.gitlab.io', 'https://uqq.gitlab.io'], + "laboratory": ['https://lab.vern.cc'], "libreSpeed": ['https://librespeed.org'], 'jitsi': ['https://meet.jit.si', 'https://8x8.vc'], 'binternet': ['https://binternet.ahwx.org'] diff --git a/src/config.json b/src/config.json index e82cc61f..a465f62e 100644 --- a/src/config.json +++ b/src/config.json @@ -761,6 +761,29 @@ "embeddable": false, "url": "https://bandcamp.com" }, + "gitlab": { + "frontends": { + "laboratory": { + "name": "Laboratory", + "instanceList": true, + "url": "https://git.vitali64.duckdns.org/utils/laboratory.git/about/" + } + }, + "targets": [ + "^https?:\\/{2}gitlab\\.com\\/", + "^https?:\\/{2}gitlab\\.freedesktop\\.com\\/", + "^https?:\\/{2}gitlab\\.archlinux\\.com\\/" + ], + "name": "Gitlab", + "options": { + "enabled": false, + "unsupportedUrls": "bypass", + "frontend": "laboratory" + }, + "imageType": "svg", + "embeddable": false, + "url": "https://gitlab.com/" + }, "wolframAlpha": { "frontends": { "wolfreeAlpha": {