Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent recursion on WKWebViewSetNativationDelegateSwizzler #26

Conversation

ArielDemarco
Copy link
Collaborator

Problem

When a WKWebView sets a navigationDelegate, our WKWebViewSetNavigationDelegateSwizzler sets our WKNavigationDelegateProxy as the delegate while retaining a reference to the original delegate to forward messages.
However, if a proxy is manually set for some reason, this setup could result in recursion.

Solution

Ensure that we do not set ourselves as the navigationDelegate multiple times to prevent recursion.

Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link

Warnings
⚠️ No CHANGELOG entry added.

Generated by 🚫 Danger Swift against d9b85e7

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.66%. Comparing base (b17b00d) to head (d9b85e7).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
- Coverage   91.66%   91.66%   -0.01%     
==========================================
  Files         386      384       -2     
  Lines       18169    18102      -67     
==========================================
- Hits        16655    16593      -62     
+ Misses       1514     1509       -5     
Files Coverage Δ
...ceCore/Capture/WebView/WebViewCaptureService.swift 82.60% <100.00%> (+0.58%) ⬆️
...s/Capture/WebView/WebViewCaptureServiceTests.swift 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

@ArielDemarco ArielDemarco merged commit 731630a into main Jul 28, 2024
12 checks passed
@ArielDemarco ArielDemarco deleted the aridemarco/fix-to-prevent-recursion-on-setNavigationDelegate branch July 28, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants