새소식

mobile/🦖 Android

코틀린 webview에서 자바스크립트 동작이 안되는 경우

  • -
728x90

🔥 Problem

👉 코틀린 webview에서 자바스크립트 동작이 안됨.

웹뷰에 특정 옵션을 주지 않으면, alert나 location.href 등 자바스크립트가 동작하지 않습니다.

🧙 Solution

👉 웹뷰에 아래의 옵션을 걸어보세요!

//웹뷰
webView.webViewClient = WebViewClient()
webView.webChromeClient = WebChromeClient()

If I was of any help to you, please buy me coffee 😿😢😥

If you have any questions, please leave them in the comments

🧭 References

[1] reference : https://doctorson0309.tistory.com/

[2] Ads : https://play.google.com/store/apps/details?id=io.cordova.seoulfilter

반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.