Skip to content

Commit 33fa795

Browse files
committed
unset user agent for hp urls
1 parent f3bee8a commit 33fa795

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/frontend/components/UI/WebviewControls/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default function WebviewControls({
9191

9292
const _url = url !== '' ? new URL(url) : null
9393
const allowList = [
94-
'store.hyperplay.xyz',
94+
'hyperplay-store-git-tech-refactorlaunchercheck-hyperplay.vercel.app',
9595
'docs.hyperplay.xyz',
9696
'app.game7.io'
9797
]

src/frontend/constants.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export const EPIC_LOGIN_URL = 'https://legendary.gl/epiclogin'
2-
export const HYPERPLAY_STORE_URL = 'https://store.hyperplay.xyz?isLauncher=true'
2+
export const HYPERPLAY_STORE_URL =
3+
'https://hyperplay-store-git-tech-refactorlaunchercheck-hyperplay.vercel.app/'
34
export const G7_PORTAL = 'https://app.game7.io/quests/hyperplay?layout=navless'
45
export const EPIC_STORE_URL = 'https://www.epicgames.com/store'
56
export const GOG_STORE_URL = `https://gog.com`

src/frontend/screens/WebView/index.tsx

+11-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ import cn from 'classnames'
3434

3535
function urlIsHpUrl(url: string) {
3636
const urlToTest = new URL(url)
37-
return urlToTest.hostname === 'store.hyperplay.xyz'
37+
return (
38+
urlToTest.hostname ===
39+
'hyperplay-store-git-tech-refactorlaunchercheck-hyperplay.vercel.app'
40+
)
3841
}
3942

4043
function shouldInjectProvider(url: string) {
@@ -96,9 +99,7 @@ function WebView({
9699
const searchParams = new URLSearchParams(search)
97100
const queryParam = searchParams.get('store-url')
98101
if (queryParam) {
99-
const queryParamAppends = urlIsHpUrl(queryParam) ? '?isLauncher=true' : ''
100-
101-
startUrl = queryParam + queryParamAppends
102+
startUrl = queryParam
102103
}
103104
} else if (pathname.match('/marketplace')) {
104105
const searchParams = new URLSearchParams(search)
@@ -279,6 +280,11 @@ function WebView({
279280
else if (shouldInjectProvider(startUrl) || pathname.match('/marketplace'))
280281
partitionForWebview = 'persist:InPageWindowEthereumExternalWallet'
281282

283+
let userAgent: string | undefined =
284+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/200.0'
285+
if (urlIsHpUrl(startUrl)) {
286+
userAgent = undefined
287+
}
282288
return (
283289
<div className={cn('WebView', classNames?.root)}>
284290
{webviewRef.current && (
@@ -296,7 +302,7 @@ function WebView({
296302
partition={partitionForWebview}
297303
src={startUrl}
298304
allowpopups={trueAsStr}
299-
useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/200.0"
305+
useragent={userAgent}
300306
{...(preloadPath ? { preload: `file://${preloadPath}` } : {})}
301307
/>
302308
{showLoginWarningFor && (

0 commit comments

Comments
 (0)