web-ui icon indicating copy to clipboard operation
web-ui copied to clipboard

How to let WebUi to use my own Chrome instead of the blue Selenium

Open yinjue opened this issue 10 months ago • 13 comments

How to let WebUi to use my own Chrome instead of the blue Selenium?

I want to avoid login problems.

I tried this but it is not working, how to debug it?

CHROME_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe" CHROME_USER_DATA="C:\Users\YourUsername\AppData\Local\Google\Chrome\User Data"

I used correct path.

yinjue avatar Feb 23 '25 04:02 yinjue

you have to change the settings under "Browser Settings" click on the "use your own browser". It is avaiable in the web ui

ananpalliyal avatar Feb 24 '25 10:02 ananpalliyal

I tried this in ubuntu, it's still opening a new browser

adarshguptacse18 avatar Feb 24 '25 16:02 adarshguptacse18

I clicked use your own browser, it still open a new browser without session cookie. The same as adarshguptacse18

yinjue avatar Feb 25 '25 00:02 yinjue

YourUsername

didnt accidententally leave this as is? Also chrome must be closed

BindingOx avatar Feb 25 '25 01:02 BindingOx

Yes I closed chrome, I use Safari to run the WebUI web interface.

CHROME_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe" CHROME_USER_DATA="C:\Users\YourUsername\AppData\Local\Google\Chrome\User Data"

I have YourUsername replaced in my Windows. It is still the same, it opens new browser session.

yinjue avatar Feb 25 '25 02:02 yinjue

check whether port 9222 is occupied on your computer. Kill the process pid occupied 9222.

If you don’t know how to do, please ask gpt first

warmshao avatar Feb 25 '25 02:02 warmshao

And you can just set CHROME_USER_DATA empty if you want to use own browser

warmshao avatar Feb 25 '25 03:02 warmshao

1.for windows

add this to the .env file

CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe

2.for linux/ubuntu

add this instead

CHROME_PATH=/usr/bin/google-chrome

this path might change depending on how you installed it and the system you use so manually check where the chrome is installed in.

windows alternatives: CHROME_PATH=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe CHROME_PATH=C:\Users{YourUsername}\AppData\Local\Google\Chrome\Application\chrome.exe

linux/ubuntu alternatives: CHROME_PATH=/usr/bin/google-chrome-stable CHROME_PATH=/opt/google/chrome/google-chrome

ananpalliyal avatar Feb 25 '25 04:02 ananpalliyal

Thank you so much, it worked now.

"And you can just set CHROME_USER_DATA empty if you want to use own browser” This actually means this don't have this line.

This is my version that worked for me: CHROME_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe" CHROME_USER_DATA=""

And for web interface of WebUI, use Firefox.

yinjue avatar Feb 25 '25 06:02 yinjue

example:

browser = await playwright.chromium.launch(headless=False, channel="chrome") #using existed chrome browser as webdriver

bolt163 avatar Feb 26 '25 07:02 bolt163

chrome portable works from https://portableapps.com/

I used:

CHROME_PATH="D:\GoogleChromePortable\GoogleChromePortable.exe"
CHROME_USER_DATA="D:\GoogleChromePortable\Data\profile"

BindingOx avatar Feb 27 '25 03:02 BindingOx

thanks [yinjue] your way works, but I have 3 profiles it opens default one which i dont want to use default for this purpose. when provided path it doesn't take old sessions even through all chrome instance closed .

-> edit(correction): Device macbook It opens last profile chrome which was running not the default. I have commented CHROME_USER_DATA from env

pruthviishere avatar Mar 04 '25 18:03 pruthviishere

Thank you so much, it worked now.

"And you can just set CHROME_USER_DATA empty if you want to use own browser” This actually means this don't have this line.

This is my version that worked for me: CHROME_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe" CHROME_USER_DATA=""

And for web interface of WebUI, use Firefox.

I closed the chrome browser and checked the checkbox for "Use Own Browser". Webui is running on firefox. But it still open blue chromium. I checked port 9222 is empty.

Update:The next day I restarted the windows PC and I found that it used own browser after I checked the checkbox for "Use Own Browser".

alexsiu398 avatar Mar 06 '25 03:03 alexsiu398