Open CanadaHonk opened 1 year ago
Can you talk more about the specific use cases that you have here? I don't know how well the CDP model will generalise across different browsers (this turned out to be surprisingly difficult with browser.close
for example, since some browsers don't want to allow you to actually close the entire browser, but just windows specifically related to automation).
My main use case is monitoring the resource usage of the browser by getting the usage of each pid given back.
Note that the SystemInfo.getProcessInfo
command is available at least in Chrome's and Firefox's CDP implementation. Generally I don't think that this should be a problem for Safari as well.
The main trouble would likely be with type
, but can likely be standardised as process models between browsers are now pretty similar.
I think being able to get PIDs makes some sense; it seems to be a concept that's sufficiently OS-agnostic that we can expose it. I agree that process types is going to be tricky; I don't think the process models are standard enough if you also want information about helper processes (e.g. processes that just handle networking, or WebGL) vs just the parent and content (render) processes.
We could define default process types like browser
, gpu
, web
, and allow the list to be extensible?
See CDP command
SystemInfo.getProcessInfo
: https://chromedevtools.github.io/devtools-protocol/tot/SystemInfo/#method-getProcessInfoNot sure what domain this could fall under (if any existing)