Fixed last slash bug when adding a custom instance https://github.com/libredirect/browser_extension/issues/996

This commit is contained in:
ManeraKai 2024-09-15 07:03:24 +03:00
parent ef4bc14882
commit ae3ae00cb7
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
1 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,8 @@ function protocolHost(url) {
if (url.pathname == "/TekstoLibre/" && url.host.endsWith("github.io"))
return `${url.protocol}//${url.host}${url.pathname.slice(0, -1)}`
return `${url.protocol}//${url.host}${url.pathname}`
const pathname = url.pathname != "/" ? url.pathname : ""
return `${url.protocol}//${url.host}${pathname}`
}
/**