seleniumselenium-webdriverpluginswebbrowser-controlundetected-chromedriver

undetected_chromedriver add a plugin


I want to add a plugin to the undetected_chromedriver driver, just like in google chrome. I did some research and tried to add it with a crx file, but I could not succeed. can you help me with this.

codes i tried

opts.add_extension('Extention/YoutubeforAdblock.crx')
opts.add_argument('--load-extension=/Extention/YoutubeforAdblock.crx')

I tried to add a plugin for the undetected_chromedriver web browser. I'm asking how this should be done.

enter code here
import undetected_chromedriver as uc

opts = uc.ChromeOptions()
opts.add_argument("--window-size=1020,900")
opts.add_extension('Extention/YoutubeforAdblock.crx')

driver = uc.Chrome(options=opts,use_subprocess=True)
driver.get('https://google.com')`

plugin i want to add

https://chrome.google.com/webstore/detail/adblock-for-youtube/cmedhionkhpnakcndndgjdbohmhepckk?hl=tr


Solution

  • .crx files are just like .zip files.

    You need to extract the crx file to use it with the undetected driver.

    1. Download your crx file in zip with a tool like this https://chrome.google.com/webstore/detail/crx-extractordownloader/ajkhmmldknmfjnmeedkbkkojgobmljda?hl=tr

    2. extract anywhere. like C:\Users\username\Desktop\extension
    (extension is folder)

    3. finally add it to your code:

    opts.add_argument('--load-extension=C:\Users\username\Desktop\extension')