I can't get values from inner functions of current webpage in Chrome. Why it's happened?
for examples in JXA:
function getTime() {
const chrome = Application('Google Chrome')
const currentTab = chrome.windows[0].activeTab()
return currentTab.execute({javascript: 'jwplayer().getPosition()'})
}
getTime()
Chrome returns reference error:
Uncaught ReferenceError: jwplayer is not defined
in AppleScript the same:
tell application "Google Chrome"
return execute front window's active tab javascript "jwplayer().getPosition()"
end tell
Settings in Chrome is checked: "Allow Javascript from Apple Events"