Skip to content

Commit 209ad91

Browse files
authored
[GOG]: ignore port provided in adtraction url (#3845)
1 parent 75bb6d9 commit 209ad91

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/frontend/screens/WebView/index.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,18 @@ export default function WebView() {
225225
if (validatedURL && validatedURL.match(/track\.adtraction\.com/)) {
226226
const parsedUrl = new URL(validatedURL)
227227
const redirectUrl = parsedUrl.searchParams.get('url')
228-
webview.loadURL(redirectUrl || 'https://gog.com')
228+
const url = new URL(redirectUrl || 'https://gog.com')
229+
// Remove any port definitions
230+
// Recently GOG made a change where they started to provide a port
231+
// in a URL that adtraction is supposed to redirect to.
232+
// This leads to urls like https://gog.com:80
233+
// That address is unreachable
234+
//
235+
// Add a entry below if you notice this line of code and cringe
236+
// - username - DD/MM/YY
237+
// - imLinguin - 01/07/24
238+
url.port = ''
239+
webview.loadURL(url.toString())
229240
if (!localStorage.getItem('adtraction-warning')) {
230241
setShowAdtractionWarning(true)
231242
}

0 commit comments

Comments
 (0)