Skip to content

[dotnet] support installing temporary addon in Firefox#10093

Closed
titusfortner wants to merge 1 commit intoSeleniumHQ:trunkfrom
titusfortner:dotnet_temp_addon
Closed

[dotnet] support installing temporary addon in Firefox#10093
titusfortner wants to merge 1 commit intoSeleniumHQ:trunkfrom
titusfortner:dotnet_temp_addon

Conversation

@titusfortner
Copy link
Copy Markdown
Member

This fixes #10084

Jim, I think this is correct, but let me know if I missed something. Thanks

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Comment on lines 291 to +293
byte[] addOnBytes = File.ReadAllBytes(addOnFileToInstall);
string base64AddOn = Convert.ToBase64String(addOnBytes);
this.InstallAddOn(base64AddOn);
this.InstallAddOn(base64AddOn, temporary);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In reading #8357 (comment) it sounds like geckodriver supports local "unpacked" extensions (if the temporary flag is set) and in that case we'd need to use the "path" parametered api in that case. Ideally we'd check to see if the path is a directory and if so, use that api, otherwise base64 up the file like we are doing now and use the AddOn api.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API will be a method that takes a path, and a method that takes a path and a temporary value. The implementation of it doesn't matter to the end user.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you that it will all work fine so long as path is the path to a .xpi or .zip but not when it is the path to an unpacked extension directory, which it would also be nice to support.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll do everything with addon keyword instead of path, so it will work the way you need. It should already work properly with .NET in 4.1, just without the temporary toggle.

@titusfortner
Copy link
Copy Markdown
Member Author

merged this instead 1b20938

@titusfortner titusfortner deleted the dotnet_temp_addon branch December 4, 2022 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-dotnet .NET Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🚀 Feature]: Java/CS FirefoxProfile to support addExtensioin temporary

2 participants