Get Chrome Tab
Is it possible to get the pid of an individual Google Chrome tab (like the current one) via the command line? Getting it through AppleScript
would be an acceptable solution.
My use case is limiting the CPU usage of a particular tab, so for now my solution is to get my pid as itll will be the tab with the highest CPU usage.
ps -Ao %cpu,pid,args | grep 'Google Chrome Helper' | sort --reverse | head -1 | awk '{ print $2 }'
which definitely works. However, there should have been a "cleaner" way by examining Chrome directly, so it's preferred.
+3
source to share