Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Multiple chrome extensions? #2672

Answered by mdmintz
Vrackko asked this question in Q&A
Discussion options

I have multiple extension paths. When i used one it was easy:

extension_path2 = f"extensions/fpd" driver = Driver(uc=True, agent=user_agent, extension_dir=extension_path2, incognito=True, proxy=proxy_cred, uc_cdp_events=True)

But i have multiple extensions. Example:

extension_path2 = f"extensions/fpd" extension_path3 = f"extensions/httphm"

I tried puting it in list but it doesnt work, it requiers string:
driver = Driver(uc=True, agent=user_agent, extension_dir=[extension_path2, extension_path3], incognito=True, proxy=proxy_cred, uc_cdp_events=True)

I also tried this solution:

extension_dirs = [extension_path2, extension_path3] combined_extension_path = ','.join(extension_dirs) driver = Driver(uc=True, agent=user_agent, extension_dir=combined_extension_path, incognito=True, proxy=proxy_cred, uc_cdp_events=True)
It renders the first path good, but second path tries to find it in my main google chrome path in extensions.

Any help with this?

You must be logged in to vote

Make sure you use a comma-separated string (no spaces) for loading multiple chrome extension directories in UC Mode.

extension_dir=None, # Load a Chrome Extension directory, comma-separated.

Also note that you can't use extensions with Incognito Mode or Guest Mode: #2336 (comment)
(That restriction was made by Google: https://support.google.com/chrome_webstore/answer/2664769?hl=en)

Replies: 2 comments 5 replies

Comment options

Make sure you use a comma-separated string (no spaces) for loading multiple chrome extension directories in UC Mode.

extension_dir=None, # Load a Chrome Extension directory, comma-separated.

Also note that you can't use extensions with Incognito Mode or Guest Mode: #2336 (comment)
(That restriction was made by Google: https://support.google.com/chrome_webstore/answer/2664769?hl=en)

You must be logged in to vote
1 reply
Comment options

Still got issue. Explanation of the issue below. Thanks for any help.

Answer selected by mdmintz
Comment options

Thanks, but still got the error. It loads the link of first correctly but the link of the second doesnt. I get the error and it try to add aditional path to the my link.

driver = Driver(uc=True, agent=user_agent, extension_dir='extensions/fpd, extensions/httphm', proxy=proxy_cred, uc_cdp_events=True)

image

You must be logged in to vote
4 replies
Comment options

I mentioned earlier in #2672 (comment): "comma-separated string (no spaces)"
You had a space in your extension_dir string.
Also, "Manifest file is missing or unreadable" means that there may be something wrong with the formatting of your extension.

Comment options

Thank you for your time to anwser. i still got same error pop up with or without the space. When i load them separately they are good, everything works, but every time i try to load them together the second one cant load. As you can see in the picture above it try to load extension from C:\Program Files\Google\Chrome\Application123円.0.6312.106... which i dont want, path of my extension is:
C:\Users\HP\Desktop\No Com\extensions\httphm. Did you run into this bug before?

extension_dir='extensions/httphm,extensions/fpd'

Edit:
I found a way but i dont think i will be able to export that:
extension_dir='extensions/fpd,httphm'

extension/fpd is in my script directory: C:\Users\HP\Desktop\No Com\extensions\fpd
httphm is in googles chrome directory: C:\Program Files\Google\Chrome\Application123円.0.6312.107\httphm

So the script works but the path to the second plugin is bugged. I wanted to move this to the server but with this option it will be really messy.

Comment options

Use import os and initialize the path of your extensions then concatenate your extensions with ',' in between in your extension_dir= argument.

root = os.getcwd()
ext_10 = os.path.abspath(os.path.join(root, 'ext/ext1'))
ext_20 = os.path.abspath(os.path.join(root, 'ext/ext2'))

with SB(uc=True, extension_dir=f'{ext_10},{ext_20}') as sb:

Comment options

@Vrackko is right about that .when there are multiple extensions to be loaded only the first one works and there is error for the rest but when we try to load them individually it works without any problem .tried with the absolute path as well but still not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /