undetected-chromedriver icon indicating copy to clipboard operation
undetected-chromedriver copied to clipboard

geolocation is per default enabled

Open PePinodemrs opened this issue 2 years ago • 4 comments

so how can i fiix it plz ? knowing that add experimental option is not carried until proven otherwise by UC

PePinodemrs avatar Aug 01 '22 19:08 PePinodemrs

    options = uc.ChromeOptions()
    prefs = {"profile.default_content_settings.geolocation": 2}
    options.add_experimental_option("prefs", prefs)
    options.add_argument("--deny-permission-prompts")
    driver = uc.Chrome(options=options)

It's possible it doesn't works since there's a bug in the 'prefs' experimental options that doesn't properly merge nested keys when they're already defined in a profile, you need a recursive dictionary update for that instead of a flat dict.update()

In this case use my fork where this bug has been fixed but the relevant pull request has never been merged by the author on this repo.

sebdelsol avatar Aug 02 '22 10:08 sebdelsol

Okay, how to install your fork with pip ?

PePinodemrs avatar Aug 02 '22 15:08 PePinodemrs

@sebdelsol do you have any way to contact you about your fork ? cause we can't open issue.

PePinodemrs avatar Aug 02 '22 23:08 PePinodemrs

pip install git+https://github.com/sebdelsol/undetected-chromedriver@master You can now open an issue

sebdelsol avatar Aug 03 '22 10:08 sebdelsol