Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Source
# Add feature: show widget only when video is playing in Google Chrome
if application "Google Chrome" is running then
tell application "Google Chrome"
repeat with t in tabs of windows
tell t
if URL starts with "" or URL starts with "" then
set isPause to execute t javascript "document.getElementsByTagName('video')[0].paused;"
if isPause is false then
return text 1 thru -11 of (title of t as text)
end if
end if
end tell
end repeat
end tell
end if
return ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment