Skip to content

Load extensions in UC Mode #1817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
FranciscoPalomares opened this issue Mar 22, 2023 · 3 comments
Closed

Load extensions in UC Mode #1817

FranciscoPalomares opened this issue Mar 22, 2023 · 3 comments
Labels
question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode

Comments

@FranciscoPalomares
Copy link

Hi, when I load extensions with uc not works, normal works:

driver = Driver(uc=True, extension_zip='./extensiones/dont_with_paste.crx')
driver = Driver(extension_zip='./extensiones/dont_with_paste.crx')
@mdmintz
Copy link
Member

mdmintz commented Mar 22, 2023

As mentioned in ultrafunkamsterdam/undetected-chromedriver#867 (comment), you need to convert your .crx file to a .zip file, and then unzip the file to a folder. Then use extension_dir=DIR as an option. UC Mode uses undetected-chromedriver, which doesn't support zipped/CRX extensions.

@mdmintz mdmintz changed the title Load extensions Load extensions in UC Mode Mar 22, 2023
@mdmintz mdmintz added the question Someone is looking for answers label Mar 22, 2023
@FranciscoPalomares
Copy link
Author

FranciscoPalomares commented Mar 22, 2023

driver = Driver(uc=True,extension_dir='extensiones/dont_with_paste') #works
driver = Driver(uc=True,extension_dir='extensiones/multilogin') #works
driver = Driver(uc=True,extension_dir='extensiones/dont_with_paste,extensiones/multilogin') #not works

@mdmintz
Copy link
Member

mdmintz commented Mar 22, 2023

Worked for me after unzipping ad_block.zip and disable_csp.zip from https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/extensions, putting those folders into a temp folder, and then running a script:

from seleniumbase import Driver

driver = Driver(uc=True, extension_dir="temp/disable_csp,temp/ad_block")
try:
    driver.get("https://nowsecure.nl/#relax")
    import pdb; pdb.set_trace()
finally:
    driver.quit()

Screenshot 2023-03-22 at 3 12 17 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode
Projects
None yet
Development

No branches or pull requests

2 participants