Last active
August 19, 2024 05:38
-
-
Save vzts/02636e9f7ab9232f3ea3fe56a01ea7f2 to your computer and use it in GitHub Desktop.
카카오톡 인앱 브라우저 탈출하기 코드 가장 심플하게 정리 (2023.10.27 동작 확인)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const userAgent = navigator.userAgent.toLowerCase() | |
if (/kakaotalk/.test(userAgent)) { | |
location.href = | |
'kakaotalk://web/openExternal?url=' + encodeURIComponent(location.href) | |
setTimeout(() => { | |
location.href = /ipad|iphone|ipod/.test(userAgent) | |
? 'kakaoweb://closeBrowser' | |
: 'kakaotalk://inappbrowser/close' | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment