mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

Add-on needs manual permissions #2131

Open aryangupta701 opened 10 months ago

aryangupta701 commented 10 months ago

Hello everyone, I was launching firefox using selenium (Java) with addon installed and the addon does not work till the user manually clicks on the addon button as shown in the screenshot below. For my use case I want the extension to be enabled by default is there any way to do this it will be really helpful.

Screenshot from 2023-08-23 00-53-06

thc202 commented 10 months ago

fyi, there's already https://bugzilla.mozilla.org/show_bug.cgi?id=1836309

aryangupta701 commented 10 months ago

Thank you

whimboo commented 10 months ago

@aryangupta701 which extension is it that you are using here? Is it publicly available?

aryangupta701 commented 10 months ago

ZAP browser extension. https://addons.mozilla.org/en-US/firefox/addon/zap-browser-extension/

Yes it is publicly available.

thc202 commented 10 months ago

It's the same extension as in the referenced issue (now renamed and newer version though).

aryangupta701 commented 10 months ago

@whimboo Do you know of any solution for this? Would be really helpful.

whimboo commented 10 months ago

I would need a small testcase for reproduction. If one of you could provide one as best in Python I would appreciate. Otherwise I'll try to have a look into that by next week given that this week will be kinda busy.

aryangupta701 commented 10 months ago

I will try to create a python script for this and share with you asap. Thank you for your help.

thc202 commented 10 months ago

@whimboo to reproduce you just need to install the extension and see that you have to manually give permissions to all sites. Did you already check https://bugzilla.mozilla.org/show_bug.cgi?id=1836309 ? afaik it's Firefox that needs (or would have to) change not geckodriver.

aryangupta701 commented 10 months ago

I agree with you this is a Firefox problem. But I think while using geckodriver we have more control over firefox (like to configure how will it behave). Maybe instead of changing the firefox policies we can do some hacks using geckodriver.

thc202 commented 10 months ago

We already went through that path and geckodriver does not have a feature for what we are asking, that's why we raised the issue for Firefox. If you are asking for help on how to use the profile with the custom settings, there's https://firefox-source-docs.mozilla.org/testing/geckodriver/Profiles.html

aryangupta701 commented 10 months ago

Oh okay. Thank you.