diff options
Diffstat (limited to 'src/assets/javascripts')
-rw-r--r-- | src/assets/javascripts/services.js | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index e93b637c..ee48a1b9 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -31,6 +31,7 @@ function all(service, frontend, options, config) { * @param {string} service * @param {URL} url * @param {{}} config + * @param {{}} options * @param {string} frontend */ function regexArray(service, url, config, options, frontend) { @@ -51,17 +52,6 @@ function regexArray(service, url, config, options, frontend) { /** * @param {URL} url - * @param {string} type - * @param {URL} originUrl - * @param {boolean} forceRedirection - */ -async function redirectAsync(url, type, originUrl, documentUrl, incognito, forceRedirection) { - await init() - return redirect(url, type, originUrl, documentUrl, incognito, forceRedirection) -} - -/** - * @param {URL} url * @param {string} frontend * @param {string} randomInstance * @returns {undefined|string} @@ -554,6 +544,13 @@ function rewrite(url, originUrl, frontend, randomInstance) { return `${randomInstance}/list?playlists=${encodeURIComponent(url.searchParams.get("list"))}` return `${randomInstance}${url.pathname}${url.search}` } + case "koub": + if (url.pathname.startsWith("/view/") || url.pathname.startsWith("/stories/")) { + return `${randomInstance}${url.pathname}${url.search}` + } + const accountReg = /^\/([^\/]+)\/?$/.exec(url.pathname) + if (accountReg) return `${randomInstance}/account${url.pathname}${url.search}` + case "piped": case "pipedMaterial": case "cloudtube": @@ -634,6 +631,20 @@ function redirect(url, type, originUrl, documentUrl, incognito, forceRedirection /** * @param {URL} url + * @param {string} type + * @param {URL} originUrl + * @param {URL} documentUrl + * @param {boolean} incognito + * @param {boolean} forceRedirection + * @returns {string | undefined} + */ +async function redirectAsync(url, type, originUrl, documentUrl, incognito, forceRedirection) { + await init() + return redirect(url, type, originUrl, documentUrl, incognito, forceRedirection) +} + +/** + * @param {URL} url * @param {*} returnFrontend */ function computeService(url, returnFrontend) { @@ -821,6 +832,7 @@ const defaultInstances = { skunkyArt: ["https://skunky.bloat.cat"], ytify: ["https://ytify.netlify.app"], nerdsForNerds: ["https://nn.vern.cc"], + koub: ["https://koub.clovius.club"], } async function getDefaults() { |