Open Bug 1561841 Opened 5 years ago Updated 1 year ago

Allow installation of extensions as specified via moz:firefoxOptions

Categories

(Testing :: geckodriver, enhancement, P3)

67 Branch
enhancement

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

()

Details

Originally filed as: https://github.com/mozilla/geckodriver/issues/1476

It would be good to allow the installation of extensions via the moz:firefoxOptions capability, like the following:

{
    "capabilities": {
        "alwaysMatch": {
            "moz:firefoxOptions": {
                "extensions": [base_64_string_extension_one, base_64_string_extension_two, ...]
            }
        }
    }
}
Severity: normal → S3

This bug got a bit lost and we discussed it recently. What we probably need are the following features:

  • base64 encoded file (.xpi)
  • option to install it temporarily
  • option to allow the extension to be run in private browsing mode

Hereby the extensions capability will only cover the general use-case but would not allow to install extensions that haven't been signed yet or are just developer builds. As such additional capabilities might have to be added as well. Here an idea:

{
  "extensions": [... ],
  "extensionsInstallTemporarily": true,
  "extensionsAllowPrivateBrowsing": true,
}

Those would then be global options that apply to each of the extensions to be installed. For installing with individual flags the other existing APIs might be needed.

What we should keep in mind is that we have all the features included to allow the webext command to actually switch to WebDriver and no longer have to use somewhat unsupported RDP commands.

Lets discuss in next weeks triage meeting.

Whiteboard: [webdriver:triage]

Could this be extended to allow extensions which can apply to any site to be enabled without explicit user approval for automation?
Related bug 1836309

Not sure I understand. Usually installed extensions are enabled by default. So does that not happen to your extension? Feel free to drop a question in our WebDriver Matrix channel and we can get it discussed.

After discussing this today there might be another option to pass the extensions and options to Firefox:

{
  "extensions": [
    "<base64_encoded_extension>",
    {"extension": "<base64_encoded_extension>", "installTemporary": true, "allowPrivateBrowsing": true},
  ],
}

That means by default extensions could be listed as usual as a list of base64 encoded strings, or if more options are needed for the install process an object could be passed with additional flags - all of them optional and default to false.

To align to what chromedriver does it might be good to have a somewhat similar structure even through those are vendor prefixed. Maxim, might you also have the need for extra options?

Flags: needinfo?(sadym)

Given that Maxim is out I've asked Vladimir Nechaev on the referenced GitHub issue for feedback.

Flags: needinfo?(sadym)
Whiteboard: [webdriver:triage]
You need to log in before you can comment on or make changes to this bug.