How to change Firefox configuration programmatically at runtime?

I want to use selenium / JUnit to test mobile emulator using

href="http://firemobilesimulator.org/?%A5%C0%A5%A6%A5%F3%A5%ED%A1%BC%A5%C9"> FireMobileSimulator plugin

Given that the plugin can emulate several different phones, I would like them to go through tests, replacing devices as needed.

The emulated device is controlled by two configuration options. Being able to manipulate them programmatically at runtime would be convenient, but I'm not sure how to do it. My google-fu is failing. Can anyone suggest a solution?

+3
source share
1 answer

, firefox. , firefox , prefs.js, user_pref(\"network.cookie.cookieBehavior\", 2);. script, selenium. , , script firefox. firefox 3.6/linux , , firefox.

, , , . , "" script, , , extensions.ini extensions/ , , - .

script , "lib", selenium-server.jar.

#!/bin/sh
set -x

# create firefox profile, cookies disabled
d=`mktemp -d -t ffp.XXXXX`
trap "rm -rf \"$d\"; exit" 0 1 2 3 15
echo "user_pref(\"network.cookie.cookieBehavior\", 2);" > "$d/prefs.js"

java -jar lib/selenium-server.jar -firefoxProfileTemplate "$d"
0

Source: https://habr.com/ru/post/1748803/