Posts

Post not yet marked as solved
4 Replies
1.1k Views
I'm trying to get a macOS WKWebView to support a standard find bar.I had hoped that, since NSScrollView supports NSTextFinderBarContainer this might be easy, but it looks like webView.enclosingScrollView returns nil and webView.scrollView doesn't exist on macOS. I suspect it's because WKWebView is using a custom scrolling/caching solution.However, following the code from WK2WebDocumentController.m I've made some progress. I can now show the find bar, perform a search, see the highlighted regions in the results, and even click the next button to jump to subsequent finds.But it doesn't auto-scroll to move to the next occurrence if it's offscreen. And if you scroll manually then the highlights aren't getting regenerated so you have ghost "holes" in the results and searching seems broken.I've tried observing NSViewBoundsDidChangeNotification and NSViewFrameDidChangeNotification for various views and then calling textFinder's setFindIndicatorNeedsUpdate:YES but that doesn't fix the issue. I think the problem is I can't access the WKWebView's scrollview or clipview reference so I can't listen to it.Does anyone have this working? I feel like I'm so close!Oh, I'm targetting Mojave and Catalina.Thanks!
Posted
by gbrowning.
Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
When using Mojave, if I install and launch my app via the Mac App Store its bundled Share extension appears in System Preferences > Extensions. However, on Catalina machines, following the same steps my extension does not appear in Extensions.If I ask LauchServices to rescan for Share extensions (via https://support.apple.com/en-us/HT203129) it still doesn't appear. Rebooting doesn't help.My app is compiled using Xcode 10.3. Runs on macOS 10.13+.- The share's Info.plist has the usual required entries: NSExtension, NSExtensionPointIdentifier, NSExtensionPrincipalClass, NSExtensionAttributes with NSExtensionActivationRule dictionary.- The app and share target are sandboxed and compiled with hardened runtime.- The submitted build was notarized by Apple.- xattr on the installed app looks fine (not quarantined). xattr on the share returns nothing.- codesign on the app and share are fine.- spctl on the app's fine.What am I missing? Did Catalina add a new requirement for macOS Share extensions?
Posted
by gbrowning.
Last updated
.