Repository navigation
feat: find in page (#27) - #82
Merged
Merged
Conversation
…nd (#27) Search text in the page, highlight the matches and move between them. FindAsync returns the match count and scrolls to the first match; FindResultsUpdated reports the active match (from 0) and the count. - Android: WebView.FindAllAsync, FindNext and ClearMatches with a FindListener (always case-insensitive). - iOS / Mac Catalyst: WKWebView reports no count, so the search runs in the page: DOM ranges of the main frame, highlighted with the CSS Custom Highlight API (iOS 17.2+) or shown as the selection, scrolled into view. - Windows: the WebView2 Find API without its find bar. - Unit tests for the page script (in Jint on a fake DOM) and the result parsing; find bar in the sample app; README section.
…rom other features
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #27
Summary
FindAsync(text, caseSensitive)(returns the match count, scrolls to the first match),FindNext(),FindPrevious(),ClearFind()and theFindResultsUpdatedevent (ActiveIndexfrom 0, -1 for none;Count).FindAllAsync/FindNext/ClearMatcheswith aFindListener; only the final count (isDoneCounting) is reported. Always case-insensitive.WKWebViewfind has no count, so a script in the page searches the main frame, highlights with the CSS Custom Highlight API (iOS 17.2+, selection before) and scrolls the active match into view.CoreWebView2.Find) withSuppressDefaultFindDialog;ActiveMatchIndexis 1-based and converted.Tests