Is it possible to get the pid of a specific Google Chrome tab (like the current one) via the command line? Getting it via AppleScript
would be an acceptable solution.
My use case is limiting the CPU usage of a specific tab, so for now my solution to get its pid, since it’ll be the tab with the highest cpu usage, is
ps -Ao %cpu,pid,args | grep 'Google Chrome Helper' | sort --reverse | head -1 | awk '{ print $2 }'
which definitely works. However, were there to be a “cleaner” way, by probing Chrome directly, that’d be preferable.