Hi Ashesh,
you are right about the code. it is also working with mac but there are few issues.
1. i was trying with non root user and it did not work. then i switched to root user and it is working fine.
i debug for this and found that CRX file of extensions are being copied in the directory /Library/Application Support/Google/Chrome/External Extensions/
which is not accessible by non root user and that is why it was not working with non root user.
in case of window off-course this path is different and it is in the build directory of chromium code and thats why no issue was there.
2. if i run
chromium.app file from terminal with sudo command on non root user. this also work fine and launch chromium with extensions but
i do not want to use sudo.
3. to get it work on non root without sudo i did a small change in your code.
i replaced chrome::DIR_EXTERNAL_EXTENSIONS to chrome::DIR_USER_EXTERNAL_EXTENSIONS
in line
if ( first_run::IsChromeFirstRun() && base::PathService::Get(chrome::DIR_EXTERNAL_EXTENSIONS, &extension_dir)) {}
of LaunchBrowser Method in startup_browser_creator.cc file.
this is working but it also have one problem. when i launch browser for the first time it does not install extensions but when i launch it for second time
extensions get installed. off-course to get it work i replaced && with || in above if condition because it check for chrome first run.
i debug for this also and this time the path to store the CRX file is ~/Library/Application Support/Chromium/External Extensions/
which is inside the user profile directory and i remember that you told that only BUILD.gn file have some possible changes and i think it need one change
of outputs path and off-course i added extensions name in else condition of that file. but unfortunately i still do not know what is right path. i think
the above user profile path might be the right path but i don't know how to pass it in
build.gn file. So what i am doing is that i am copying CRX file by a script at runtime
into above path So when i launch profile first time, script is not able to copy extensions because profile path does not exist at that time. for second time it find path and
chrome launches extensions. i know this is not the right way of doing it. ideally this should have been done by source code itself if BUILD.gn was provided the right path.
i studied documentations on gn files but unfortunately i could not find a way to pass above path in gn file because almost all outputs path are correspond to build directory.
i know you don't do development on mac but i think the problem is only about passing right path to
build.gn file.
please help if you can.
ThankYou