Skip to content

feat: 새 창으로 열기 옵션 링크 내부에서 열기#186

Merged
chanhihi merged 1 commit intodevelopfrom
dev/185-feat-새-창으로-열기-옵션-링크-내부에서-열기/#185
Apr 16, 2024

Hidden character warning

The head ref may contain hidden characters: "dev/185-feat-\uc0c8-\ucc3d\uc73c\ub85c-\uc5f4\uae30-\uc635\uc158-\ub9c1\ud06c-\ub0b4\ubd80\uc5d0\uc11c-\uc5f4\uae30/#185"
Merged

feat: 새 창으로 열기 옵션 링크 내부에서 열기#186
chanhihi merged 1 commit intodevelopfrom
dev/185-feat-새-창으로-열기-옵션-링크-내부에서-열기/#185

Conversation

@noeyiz
Copy link
Collaborator

@noeyiz noeyiz commented Apr 11, 2024

📌 개요

  • "새 창으로 열기" 옵션이 설정된 (target="_blank") 링크를 웹뷰 내부에서 열기 위해 WKNavigationDelegate에 함수를 구현했습니다.

💻 작업 내용

func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
    // "새 창으로 열기" 링크 WebView 내에서 열기
    if navigationAction.targetFrame == nil {
        webView.load(navigationAction.request)
    }
    decisionHandler(.allow)
}

@noeyiz noeyiz added the ✨ Enhancement New feature or request label Apr 11, 2024
@noeyiz noeyiz self-assigned this Apr 11, 2024
@noeyiz noeyiz linked an issue Apr 11, 2024 that may be closed by this pull request
Copy link
Member

@chanhihi chanhihi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 ~

@chanhihi chanhihi merged commit 898eb1e into develop Apr 16, 2024
@chanhihi chanhihi deleted the dev/185-feat-새-창으로-열기-옵션-링크-내부에서-열기/#185 branch April 16, 2024 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 새 창으로 열기 옵션 링크 내부에서 열기

2 participants