I want to disable the horizontal scroll elasticity of an NKWebView instance in my app for macOS.
I know we can control elasticity of an NSScrollView with verticalScrollElasticity
or horizontalScrollElasticity
properties. But it seems to be impossible to obtain scrollView from new WKWebView on macOS, although WKWebView for iOS has a scrollView
property that holds UIScrollView. I also cannot find a proper property in WKWebView to control it.
I found a Q&A: Disable rubber-band scrolling for webview in lion in SO for the old WebView. But it doesn't work anymore with a new WKWebView since new WKWebView doesn't have a mainFrame
property.