From 51f7e4a6ad6c00367edd422c41409a76fcae7891 Mon Sep 17 00:00:00 2001 From: younesaassila <47226184+younesaassila@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:59:03 +0100 Subject: [PATCH] Hotfix IPv4 proxies not working in Chrome --- package-lock.json | 4 ++-- package.json | 2 +- src/common/ts/proxyInfo.ts | 5 ++++- src/manifest.chromium.json | 2 +- src/manifest.firefox.json | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index f78f6926..ab080fd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ttv-lol-pro", - "version": "2.3.1", + "version": "2.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ttv-lol-pro", - "version": "2.3.1", + "version": "2.3.2", "license": "GPL-3.0", "dependencies": { "bowser": "^2.11.0", diff --git a/package.json b/package.json index 240d1e75..b15b7f88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ttv-lol-pro", - "version": "2.3.1", + "version": "2.3.2", "description": "TTV LOL PRO removes most livestream ads from Twitch.", "@parcel/bundler-default": { "minBundles": 10000000, diff --git a/src/common/ts/proxyInfo.ts b/src/common/ts/proxyInfo.ts index e91782f3..4265ef49 100644 --- a/src/common/ts/proxyInfo.ts +++ b/src/common/ts/proxyInfo.ts @@ -71,7 +71,10 @@ export function getUrlFromProxyInfo(proxyInfo: ProxyInfo): string { } else if (username) { url = `${username}@`; } - if (ip.isV6Format(host)) { + const isIPv4 = ip.isV4Format(host); + const isIPv6 = ip.isV6Format(host); + // isV6Format() returns true for IPv4 addresses, so we need to exclude those. + if (isIPv6 && !isIPv4) { url += `[${host}]`; } else { url += host; diff --git a/src/manifest.chromium.json b/src/manifest.chromium.json index 4f49fc80..c4719eb7 100644 --- a/src/manifest.chromium.json +++ b/src/manifest.chromium.json @@ -3,7 +3,7 @@ "name": "TTV LOL PRO", "description": "TTV LOL PRO removes most livestream ads from Twitch.", "homepage_url": "https://github.com/younesaassila/ttv-lol-pro", - "version": "2.3.1", + "version": "2.3.2", "background": { "service_worker": "background/background.ts", "type": "module" diff --git a/src/manifest.firefox.json b/src/manifest.firefox.json index 357a34a1..4eeae61d 100644 --- a/src/manifest.firefox.json +++ b/src/manifest.firefox.json @@ -3,7 +3,7 @@ "name": "TTV LOL PRO", "description": "TTV LOL PRO removes most livestream ads from Twitch.", "homepage_url": "https://github.com/younesaassila/ttv-lol-pro", - "version": "2.3.1", + "version": "2.3.2", "background": { "scripts": ["background/background.ts"], "persistent": false