This commit is contained in:
Maurice Parker 2019-10-18 20:37:29 -05:00
commit 810f1ab0ee
1 changed files with 4 additions and 1 deletions

View File

@ -205,7 +205,10 @@ private extension DetailWebViewController {
}
func fetchScrollInfo(_ callback: @escaping (ScrollInfo?) -> Void) {
let javascriptString = "var x = {contentHeight: document.body.scrollHeight, offsetY: document.body.scrollTop}; x"
var javascriptString = "var x = {contentHeight: document.body.scrollHeight, offsetY: document.body.scrollTop}; x"
if #available(macOS 10.15, *) {
javascriptString = "var x = {contentHeight: document.body.scrollHeight, offsetY: window.pageYOffset}; x"
}
webView.evaluateJavaScript(javascriptString) { (info, error) in
guard let info = info as? [String: Any] else {