AW-429-comp-v1-ios-ab
This commit is contained in:
parent
eb835667e3
commit
6606f5f2d0
10
index.html
10
index.html
@ -2,6 +2,16 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script>
|
||||
const ua = window.navigator.userAgent;
|
||||
if (
|
||||
ua.includes("Instagram")
|
||||
) {
|
||||
if (/iPad|iPhone|iPod/.test(ua)) {
|
||||
window.location.href = "x-safari-" + window.location.href;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- Start cookieyes banner -->
|
||||
<script id="cookieyes" type="text/javascript"
|
||||
src="https://cdn-cookieyes.com/client_data/818f2bf465f49092b0fd7078/script.js"></script>
|
||||
|
||||
@ -20,6 +20,7 @@ import { EUnleashFlags, useUnleash } from "@/hooks/ab/unleash/useUnleash";
|
||||
import GenderV0 from "./variants/GenderV0";
|
||||
import GenderV1 from "./variants/GenderV1";
|
||||
import GenderV2 from "./variants/GenderV2";
|
||||
import { instagramToBrowser } from "@/services/hacks/insta-to-browser";
|
||||
|
||||
function GenderPage() {
|
||||
const { translate } = useTranslations(ELocalesPlacement.CompatibilityV2);
|
||||
@ -105,6 +106,7 @@ function GenderPage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (privacyPolicyChecked && gender && isSelected) {
|
||||
instagramToBrowser(["android"]);
|
||||
handleNext();
|
||||
}
|
||||
}, [gender, handleNext, isSelected, privacyPolicyChecked]);
|
||||
|
||||
@ -20,6 +20,7 @@ import { EGender, ESourceAuthorization } from "@/api/resources/User";
|
||||
import AlreadyHaveAccount from "@/components/ui/AlreadyHaveAccount";
|
||||
import Answer from "../../components/Answer";
|
||||
import Loader, { LoaderColor } from "@/components/Loader";
|
||||
import { instagramToBrowser } from "@/services/hacks/insta-to-browser";
|
||||
|
||||
function GenderPage() {
|
||||
const { translate } = useTranslations(ELocalesPlacement.CompatibilityV3);
|
||||
@ -99,6 +100,7 @@ function GenderPage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (privacyPolicyChecked && gender && isSelected) {
|
||||
instagramToBrowser(["android"]);
|
||||
handleNext();
|
||||
}
|
||||
}, [gender, handleNext, isSelected, privacyPolicyChecked]);
|
||||
|
||||
@ -19,6 +19,7 @@ import Loader, { LoaderColor } from "@/components/Loader";
|
||||
import GenderV0 from "./variants/GenderV0";
|
||||
import GenderV1 from "./variants/GenderV1";
|
||||
import GenderV2 from "./variants/GenderV2";
|
||||
import { instagramToBrowser } from "@/services/hacks/insta-to-browser";
|
||||
|
||||
function GenderPage() {
|
||||
const { translate } = useTranslations(ELocalesPlacement.CompatibilityV4);
|
||||
@ -98,6 +99,7 @@ function GenderPage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (privacyPolicyChecked && gender && isSelected) {
|
||||
instagramToBrowser(["android"]);
|
||||
handleNext();
|
||||
}
|
||||
}, [gender, handleNext, isSelected, privacyPolicyChecked]);
|
||||
|
||||
@ -19,6 +19,7 @@ import { useSession } from "@/hooks/session/useSession";
|
||||
import { EGender, ESourceAuthorization } from "@/api/resources/User";
|
||||
import AlreadyHaveAccount from "@/components/ui/AlreadyHaveAccount";
|
||||
import Answer from "../../components/Answer";
|
||||
import { instagramToBrowser } from "@/services/hacks/insta-to-browser";
|
||||
|
||||
function GenderPalmistry() {
|
||||
const { translate } = useTranslations(ELocalesPlacement.PalmistryV1);
|
||||
@ -87,6 +88,7 @@ function GenderPalmistry() {
|
||||
|
||||
useEffect(() => {
|
||||
if (privacyPolicyChecked && gender && isSelected) {
|
||||
instagramToBrowser(["android"]);
|
||||
handleNext();
|
||||
}
|
||||
}, [gender, handleNext, isSelected, privacyPolicyChecked]);
|
||||
|
||||
12
src/services/hacks/insta-to-browser.ts
Normal file
12
src/services/hacks/insta-to-browser.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export const instagramToBrowser = (includeSystems: Array<"android" | "ios">) => {
|
||||
const ua = window.navigator.userAgent;
|
||||
if (
|
||||
ua.includes("Instagram")
|
||||
) {
|
||||
if (includeSystems.includes("ios") && /iPad|iPhone|iPod/.test(ua)) {
|
||||
window.location.href = "x-safari-" + window.location.href;
|
||||
} else if (includeSystems.includes("android") && /Android/.test(ua)) {
|
||||
window.location.href = "intent:" + window.location.href + "#Intent;end";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user