-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add FXIOS-8087 [v124] find in page web engine #18622
Add FXIOS-8087 [v124] find in page web engine #18622
Conversation
@@ -116,6 +125,15 @@ class WKEngineSession: NSObject, | |||
webView.engineScrollView.setContentOffset(CGPoint.zero, animated: true) | |||
} | |||
|
|||
func findInPage(text: String, function: FindInPageFunction) { | |||
let sanitizedInput = text.replacingOccurrences(of: "\\", with: "\\\\").replacingOccurrences(of: "\"", with: "\\\"") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just OOC is this something being brought over from the existing client? Wondering if there is a more elegant way for us to avoid how we're escaping these slashes but I'm not super-familiar with this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's brought from the existing code 🤔 It's from here exactly
Generated by 🚫 Danger Swift against 1dbaf6a |
5d749fe
to
1dbaf6a
Compare
📜 Tickets
Jira ticket
Github issue
💡 Description
Add the Find in page functionality in the
WebEngine
, as it is working today in Firefox iOS.EngineSession
protocol, as well as a new delegate. Kept this separeted from theEngineSessionDelegate
so we keep smaller responsibilities.FindInPageContentScript
that communicates with theFindInPage.js
and receive WebKit messages. Added tests for this content script.SampleBrowser
app -> This means missing images and scripts that should be injected.SampleBrowser
app to test this feature, see video for result - focus is on testing the web engine, not UI perfection :)Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-02-07.at.11.57.46.mp4
📝 Checklist
You have to check all boxes before merging