From 9699a401478947a84ea71215bc5c2e5da61d86c1 Mon Sep 17 00:00:00 2001 From: lartsch Date: Tue, 22 Nov 2022 09:48:06 -0500 Subject: [PATCH] fix some handle domains not resolving --- src/inject.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/inject.js b/src/inject.js index 8741e67..1b00fde 100644 --- a/src/inject.js +++ b/src/inject.js @@ -327,7 +327,7 @@ function processFollow() { } } if (handleDomain && handle) { - var requestUrl = location.protocol + "//" + location.host + searchApi + "/?q=" + encodeURIComponent(handleDomain) + "&resolve=false&limit=10"; + var requestUrl = location.protocol + "//" + location.host + searchApi + "/?q=" + encodeURIComponent(handle+"@"+handleDomain) + "&resolve=false&limit=10"; var response = await makeRequest("GET", requestUrl, null); var result; if (response) { @@ -347,13 +347,12 @@ function processFollow() { setTimeout(function() { redirectToHomeInstance(redirectUrl); // restore original button text - $(found).text(originaltext); + $(found).html(originaltext); }, 1000); } else { log("Could not get instance URL from API search, attempting raw redirect.") // replace the button text to indicate redirection $(found).text("Redirecting..."); - var redirectUrl = result + "/" + handle; // timeout 1000ms to make it possible to notice the redirection indication setTimeout(function() { redirectToHomeInstance(window.location.href);