These scripts work well with my macOS 10.12.5beta+Safari 10.1.1.
I have houndreds of Safari script. But I can not check them all now.
tell application "Safari"
tell document 1
--do _javascript_ "window.innerHeight"
set aRes to (do _javascript_ "String(document.body.clientHeight)")
do _javascript_ "window.scroll(0," & aRes & ")"
end tell
end tell
tell application "Safari"
-- the number of links in the front document
set i to do _javascript_ "document.links.length" in document 1
set linkList to {}
repeat with j from 0 to i
-- getting the target URL of the first link of the front document
set the end of linkList to do _javascript_ ("document.links[" & j as text) & "].text" in document 1
end repeat
linkList
end tell