Skip to content

Commit

Permalink
Fix opening native android browser
Browse files Browse the repository at this point in the history
  • Loading branch information
broody committed Jan 8, 2025
1 parent 11a7727 commit cce2ae2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ function getNativeBrowserUrl() {
}
// Android: Open in Chrome
if (/Android/.test(navigator.userAgent)) {
return `intent:${window.location.href}#Intent;scheme=https;package=com.android.chrome;end`;
let currentUrl = window.location.href;
currentUrl = currentUrl.replace(/^https?:\/\//, "");
return `intent://${currentUrl}#Intent;scheme=https;package=com.android.chrome;end`;
}
return null;
}
Expand Down Expand Up @@ -179,7 +181,7 @@ export function CreateController({
window.location.href = nativeBrowserUrl;
}
}
}, []);
}, [isInApp]);

const handleUsernameChange = (value: string) => {
if (!hasLoggedChange.current) {
Expand Down

0 comments on commit cce2ae2

Please sign in to comment.