'How to retrieve `--user-data-dir` path in JavaScript?

I know we are able to launch chrome and specify which Chrome Profile to use by adding the --user-data-dir flag when launching as such:

chrome.exe --user-data-dir="C:\Users\user\Desktop\Project\TestChromeProfile"

However, I'm wondering if there's any way we could get that --user-data-dir path in the browser by executing a code.

Perhaps something like this?

chrome.runtime.getProfilePath(); 
//Returns the path 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source