From e3c603562498d23a32229004d774f4d2e5dd4d65 Mon Sep 17 00:00:00 2001 From: lxhom <73352734+lxhom@users.noreply.github.com> Date: Tue, 25 Apr 2023 18:22:37 +0200 Subject: [PATCH] allow url loading via query param without `u=` for example https://co.wukko.me/?u=https://www.reddit.com/r/196/comments/12yeg91/rule/ worked before, but https://co.wukko.me/?https://www.reddit.com/r/196/comments/12yeg91/rule/ didnt load the url. this checks the search string without query params if the query param u isn't found, allowing the 2nd url to work --- src/front/cobalt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/front/cobalt.js b/src/front/cobalt.js index 8b8d9732..00381f9d 100644 --- a/src/front/cobalt.js +++ b/src/front/cobalt.js @@ -432,7 +432,7 @@ window.onload = () => { eid("url-input-area").value = ""; notificationCheck(); if (isIOS) sSet("downloadPopup", "true"); - let urlQuery = new URLSearchParams(window.location.search).get("u"); + let urlQuery = new URLSearchParams(window.location.search).get("u") || window.location.search.substring(1); if (urlQuery !== null && regex.test(urlQuery)) { eid("url-input-area").value = urlQuery; button();