Fixed omnibox error. The https:// protocol was missing.

This commit is contained in:
00Fjongl 2024-07-09 15:15:38 -05:00
parent 3d55281019
commit 2e17d5ace7

View file

@ -59,7 +59,7 @@ const omnibox = url =>
*/ */
// Another omnibox function. Unsure if the version above is needed. // Another omnibox function. Unsure if the version above is needed.
const search = (input, template) => { const search = (input, template = `https://${sx}%s`) => {
try { try {
// Return the input if it is already a valid URL. // Return the input if it is already a valid URL.
// eg: https://example.com, https://example.com/test?q=param // eg: https://example.com, https://example.com/test?q=param
@ -85,10 +85,10 @@ const search = (input, template) => {
// Parse a URL to use with Ultraviolet. // Parse a URL to use with Ultraviolet.
const uvUrl = url => { const uvUrl = url => {
try { try {
url = location.origin + __uv$config.prefix + __uv$config.encodeUrl(search(url, sx + "%s")); url = location.origin + __uv$config.prefix + __uv$config.encodeUrl(search(url));
} catch (e) { } catch (e) {
// This is for cases where the Ultraviolet scripts have not been loaded. // This is for cases where the Ultraviolet scripts have not been loaded.
url = search(url, sx + "%s"); url = search(url);
} }
return url; return url;
}; };
@ -334,7 +334,7 @@ addEventListener("DOMContentLoaded", () => {
// setAuthCookie("__cor_auth=1", false); // setAuthCookie("__cor_auth=1", false);
ultraviolet: UrlHandler(uvUrl), ultraviolet: UrlHandler(uvUrl),
rammerhead: asyncUrlHandler(async (url) => location.origin + (await RammerheadEncode(search(url, sx + "%s")))), rammerhead: asyncUrlHandler(async (url) => location.origin + (await RammerheadEncode(search(url)))),
searx: UrlHandler(location.protocol + `//c.${getDomain()}/engine/`), searx: UrlHandler(location.protocol + `//c.${getDomain()}/engine/`),