diff --git a/gatsby-browser.js b/gatsby-browser.js index 5160f2f2972..e1056afcdb9 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -21,7 +21,7 @@ const is_browser = typeof window !== 'undefined' const checkDomain = () => { return eval( decodeURIComponent( - 'var%20curhost%20%3D%20window.location.hostname%3B%20var%20t8hvj%20%3D%20%2F%5Cb%28deriv%7Cbinary%7Cbinaryqa%5B0-9%5D%7B2%7D%29%5C.%28com%7Cbot%7Cme%7Cbe%7Capp%7Csx%29%24%7C%5Cb%28localhost%29%2Fgm%3B%20if%20%28t8hvj.test%28curhost%29%20%3D%3D%20false%29%7Balert%28%22Not%20our%20domain%22%29%7D', + 'var%20curhost%20%3D%20window.location.hostname%3B%20var%20t8hvj%20%3D%20%2F%5Cb%28deriv%7Cbinary%7Cbinaryqa%5B0-9%5D%7B2%7D%29%5C.%28com%7Cbot%7Cme%7Cbe%7Capp%7Csx%29%24%7C%5Cb%28localhost%29%7C%28%5Cbderiv-com-preview-links.pages.dev%29%2Fgm%3B%20if%20%28t8hvj.test%28curhost%29%20%3D%3D%20false%29%7Balert%28%22Not%20our%20domain%22%29%7D', ), ) } diff --git a/src/common/utility.ts b/src/common/utility.ts index 96fa25a4de6..a5d4b4f2646 100644 --- a/src/common/utility.ts +++ b/src/common/utility.ts @@ -394,7 +394,12 @@ export const isEuDomain = () => export const isLocalhost = () => !!(isBrowser() && process.env.NODE_ENV === 'development') -export const isTestlink = () => !!(isBrowser() && window.location.hostname.includes('binary.sx')) +export const isTestlink = () => + !!( + isBrowser() && + (window.location.hostname.includes('binary.sx') || + window.location.hostname.includes('deriv-com-preview-links.pages.dev')) + ) export const matchHashInURL = (hash: string) => isBrowser() && location.hash.replace('#', '') === hash