remove port from invidious domain as it is not needed

This commit is contained in:
Ajay 2023-07-11 17:05:08 -04:00
parent ab4035bbc5
commit 3175d7f8e9
2 changed files with 6 additions and 3 deletions

View file

@ -445,7 +445,12 @@ function invidiousInstanceAddInit(element: HTMLElement, option: string) {
let instanceList = Config.config[option];
if (!instanceList) instanceList = [];
instanceList.push(textBox.value.trim().toLowerCase());
let domain = textBox.value.trim().toLowerCase();
if (domain.includes(":")) {
domain = domain.split(":")[0];
}
instanceList.push(domain);
Config.config[option] = instanceList;

View file

@ -240,8 +240,6 @@ export default class Utils {
for (const url of domains) {
permissionRegex.push("https://*." + url + "/*");
permissionRegex.push("http://*." + url + "/*");
permissionRegex.push("https://" + url + "/*");
permissionRegex.push("http://" + url + "/*");
}
return permissionRegex;