Skip to content

Instantly share code, notes, and snippets.

View boxqkrtm's full-sized avatar

whitetac boxqkrtm

  • 13:28 (UTC +09:00)
View GitHub Profile
@hmmhmmhm
hmmhmmhm / avoid-in-app.js
Created August 19, 2024 05:38 — forked from vzts/avoid-in-app.js
카카오톡 인앱 브라우저 탈출하기 코드 가장 심플하게 정리 (2023.10.27 동작 확인)
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'
})