Is there a command line flag to enable flash for firefox?

Viewed 307

I am working on our automation tests, and I can't figure out how to start our Browserstack firefox browser with flash enabled/allowed.

Is there a flag for firefox that enables/allows flash ?

We are using Karma as a test runner.

I have tried :

var FirefoxProfile = require('firefox-profile');
var myProfile = new FirefoxProfile();
myProfile.setPreference("plugin.state.flash", 2);
myProfile.updatePreferences();

Along with :

module.exports = function (config) {
    config.set({
        basePath: "",
        browserNoActivityTimeout: 60000,
        browserStack: {
            username: "myUsername",
            accessKey: "myAccessKey",
            forcelocal: true,
            timeout: 1000, 
            firefox_profile: myProfile
        },
        client: {
            mocha: {
                timeout: 60000,
                ui: interfaceType
            },
            useIframe: true
        },
        customLaunchers: {
            "bs_chrome_mac": {
                base: "BrowserStack",
                browser: "chrome",
                browser_version: "56",
                os: "OS X",
                os_version: "Sierra"
            },
            "firefox-osx" : {
                base: "BrowserStack",
                browser: "Firefox", 
                browser_version: "63.0",
                os: "OS X",
                os_version: "Sierra", 
                profile: myProfile
            },
2 Answers
For Firefox browser - 

 FirefoxProfile profile = new FirefoxProfile();
 profile.setPreference("plugin.state.flash", 2);
 caps.setCapability("browserstack.use_w3c", "true");

The above mentioned code snippet to enable flash is in Java. You can port them to your language of choice.

Related