X
Tap here to go to the mobile version of the site.

Support Forum

How to change the language settings of firefox using JavaScript

Posted

My question is: How to change the language settings of the firefox using JavaScript:

I want set the value of the intl.accept_languages to fr using JavaScript.

How can i do it?

EDIT: The mail reason, i want to acheive this is to be able to run Selenium test cases for different languages with out changing it manually rather progrmmetically

My question is: How to change the language settings of the firefox using JavaScript: I want set the value of the '''intl.accept_languages''' to '''fr''' using JavaScript. How can i do it? EDIT: The mail reason, i want to acheive this is to be able to run '''Selenium''' test cases for different languages with out changing it manually rather progrmmetically

Modified by deter_dangler

Chosen solution

You will have to close and change the pref via user.js or prefs.js before restarting Firefox to do the next test.

See:

Read this answer in context 0

Additional System Details

Installed Plug-ins

  • Office Plugin for Netscape Navigator
  • Java(TM) Platform SE binary
  • ActiveTouch General Plugin Container Version 105
  • Default Plug-in
  • Shockwave Flash 10.0 r42
  • 4.0.50524.0
  • Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
  • Java Plug-in 1.5.0_15 for Netscape Navigator (DLL Helper)
  • Adobe Acrobat Plug-In Version 7.00 for Netscape
  • DRM Netscape Network Object
  • DRM Store Netscape Plugin
  • Npdsplay dll

Application

  • User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13

More Information

the-edmeister
  • Top 10 Contributor
  • Moderator
4142 solutions 31201 answers

Helpful Reply

From a webpage?

From a webpage?
cor-el
  • Top 10 Contributor
  • Moderator
13047 solutions 119473 answers

You do not have access to prefs via JavaScript on websites or via a bookmarklet. Only extensions are able to change prefs.

See http://developer.mozilla.org/en/Code_snippets/Preferences


Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.

  1. Shockwave Flash 10.0 r42
  2. Java Plug-in 1.5.0_15 for Netscape Navigator (DLL Helper)

Update the Flash plugin to the latest version.

Update the Java plugin to the latest version.

You do not have access to prefs via JavaScript on websites or via a bookmarklet. Only extensions are able to change prefs. See http://developer.mozilla.org/en/Code_snippets/Preferences ---- Your above posted system details show outdated plugin(s) with known security and stability risks that you should update. # Shockwave Flash 10.0 r42 # Java Plug-in 1.5.0_15 for Netscape Navigator (DLL Helper) Update the [[Managing the Flash plugin|Flash]] plugin to the latest version. *http://www.adobe.com/software/flash/about/ Update the [[Java]] plugin to the latest version. *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

Question owner

I am using selenium 1.0 to run automated tests..My requirement is i want to change the language settings of the firefox programmetically..so that each run uses different language.

I am using selenium 1.0 to run automated tests..My requirement is i want to change the language settings of the firefox programmetically..so that each run uses different language.
cor-el
  • Top 10 Contributor
  • Moderator
13047 solutions 119473 answers

Chosen Solution

You will have to close and change the pref via user.js or prefs.js before restarting Firefox to do the next test.

See:

You will have to close and change the pref via user.js or prefs.js before restarting Firefox to do the next test. See: * http://kb.mozillazine.org/Editing_configuration#How_to_edit_configuration_files * http://kb.mozillazine.org/user.js_file