Skip to content

Commit

Permalink
[GOG]: ignore port provided in adtraction url (#3845)
Browse files Browse the repository at this point in the history
  • Loading branch information
imLinguin authored Jul 2, 2024
1 parent 75bb6d9 commit 209ad91
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/frontend/screens/WebView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,18 @@ export default function WebView() {
if (validatedURL && validatedURL.match(/track\.adtraction\.com/)) {
const parsedUrl = new URL(validatedURL)
const redirectUrl = parsedUrl.searchParams.get('url')
webview.loadURL(redirectUrl || 'https://gog.com')
const url = new URL(redirectUrl || 'https://gog.com')
// Remove any port definitions
// Recently GOG made a change where they started to provide a port
// in a URL that adtraction is supposed to redirect to.
// This leads to urls like https://gog.com:80
// That address is unreachable
//
// Add a entry below if you notice this line of code and cringe
// - username - DD/MM/YY
// - imLinguin - 01/07/24
url.port = ''
webview.loadURL(url.toString())
if (!localStorage.getItem('adtraction-warning')) {
setShowAdtractionWarning(true)
}
Expand Down

0 comments on commit 209ad91

Please sign in to comment.