19

I developed a Chrome-Extension and want to know if it is possible to get CPU usage of any tab in Chrome (please see the image)? I saw a few questions which are very old. Maybe there is some new techniques to get the CPU usage for each tab.

enter image description here

4
  • 3
    See the documentation
    – wOxxOm
    Feb 6, 2018 at 12:49
  • 4
    developer.chrome.com/extensions/processes#method-getProcessInfo is still in the dev channel and not yet available, but will provide more information about each running process.
    – holmberd
    Feb 6, 2018 at 15:00
  • i installed chrome dev and run the code chrome.processes.getProcessInfo but got following error: Uncaught TypeError: Cannot read property 'getProcessInfo' of undefined at <anonymous>:1:18 Feb 7, 2018 at 22:37
  • Please update your question , insert getProcessInfo segment. May 30, 2018 at 9:48

1 Answer 1

3

It is possible. You need to request the permission: "processes" first in your manifest.json with something like:

{
  "name": "My extension...",
  ...
  "permissions": [ "processes" ],
  ...
}

If you are on dev-channel you'll have chrome.processes available. On other channels the extensions will be rejected with an error saying:

'processes' requires dev channel or newer, but this is the stable channel.

chrome.processes in dev tools

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.