Testing Firefox Browsers - firefox

With Firefox updating more quickly, how do I test my sites on version 3 through the current version? Can I have multiple versions installed? How do I set that up?

You can either run the installer for each (putting them in separate directories) or extract the content of the zip file for your platform.
Running firefox -ProfileManager will allow you to create new profiles (one per firefox version).
You can then run firefox -P <profile> (or create a shortcut in windows (don't forget to edit the properties to add the command line option) or shell script for it).
NOTE: run firefox -? for help.

Yes, you can have multiple versions but you should create a new .profile for each one so data doesn't overlap.

Related

Open Firefox with a temporary add-on on startup

Is there a way in which I can open Firefox and force it to load a temporary add-on (webextension) on startup? Normally I have to manually go to about:debugging and select the extension on my hard drive. I'm looking for a flag I can pass when I load Firefox so that this is done automatically.
If this is not possible, is there a recommended extension I can install to simulate that a user opens this URL and adds this extension?
Yes, you can use the command web-ext run from the directory in which the extension exists. This will start Firefox with the WebExtension installed using a temporary profile. web-ext run is intended for testing your WebExtension add-on during development, not for normal use of Firefox. By default, the web-ext run command will watch your WebExtension's files and automatically reload the extension when any of the files are changed. You can disable this feature by using the --no-reload option.
If you are using a Firefox version below 49, you will need to specify the --pre-install option which uses a different method of installing the extension in the profile. However, if you use the --pre-install, your WebExtension will not be operational if you are trying to use a release or beta version of Firefox and the extension is not signed. This basically means that using --pre-install is not useful for Firefox versions below 49 unless you are using a Developer Edition build. Using --pre-install can be useful for Developer Edition versions of Firefox above 49 if you are wanting to test how your extension behaves during Firefox startup. If you do not use the --pre-install option, your extension is installed as a temporary extension and does not need to be signed to be tested in release versions of Firefox.
If you want to use a specific profile, then you need to specify the profile using the --firefox-profile option. MDN says:
When using a custom profile, web-ext first copies the profile. The custom profile will not be altered.
Installing web-ext
You will need to install web-ext. You can do so by following the instructions in Getting started with web-ext. The instructions are to, after you install node/npm, run the following command:
npm install --global web-ext
References
Getting started with web-ext
web-ext command reference

program to install firefox exetension in windows?

Is it possible to build a installer(or program) in windows 7, that can install extension to firefox (if the browser installed on the machine).
or atleast help me by providing command to install firefox extension through command line in windows7.
("firefox addon.xpi" command is available in linux)
Thanks
Installation of extension in Firefox is very simple.
You need to launch Firefox.exe with your .xpi file as parameter
The official documentation says you should use -install-global-extension switch (not sure why, it should worked also without it, at least in older versions it did).
firefox.exe -install-global-extension "<path>\extension-file.xpi"
Details here: http://kb.mozillazine.org/Command_line_arguments
If you want to create whole installer with this feature, let's say in NSIS:
Function InstallFirefoxExt
InitPluginsDir
SetOutpath "$PLUGINSDIR\"
File "extension-file.xpi" # Extract file to temporary directory
Exec '"<path>\firefox.exe" -install-global-extension "$PLUGINSDIR\\extension-file.xpi"'
FunctionEnd
If you use other installation system it is very similar.
To install a Firefox extension on Windows you should simply add a value to the Windows registry. This can be done by opening a .reg file or running reg.exe with the right parameters, a custom Windows application to add it would also be trivial. Adding to HKEY_CURRENT_USER can be done without advanced privileges (no UAC prompt), adding to HKEY_LOCAL_MACHINE (for all users) requires administrator privileges.
I would advise against using -install-global-extension since that adds the extension to the Firefox application directory - you have to know where Firefox is installed, administrator privileges are always required and updating/uninstalling the extension is non-trivial. Also, firefox addon.xpi will install into the default user profile - in addition to the disadvantages of -install-global-extension this doesn't consider the fact that more user profiles could exist on the computer (or be created in future).
Firefox path can be detected by reading this registry key:
"HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\20.0.1 (en-US)\Main" "PathToExe"
On my PC this PathToExe looks like "C:\Program Files\Mozilla Firefox\firefox.exe" so this is exactly the value you need.
However this is a little tricky because the key contains Firefox version 20.0.1 (en-US)
To get this version at first read this key:
"HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox" "CurrentVersion"
which will return 20.0.1 (en-US)
Simply join all parts together:
"HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\" + <CurrentVersion> + "\Main"
to get whole key.

Open multiple firefox instances with different profiles on Mac OS X

What is the best way to open different firefox instances (firefox 3 to 10) with different profiles (on 10.5, 10.6 and 10.7)?
With versions prior to Firefox-7, modifying the content of the firefox package and adding -no-remote -P {PROFILE} worked.
However, with the latest versions of firefox it's not working.
I've also tried with Automator without success.
Has anyone faced a similar problem and fixed it?
Thanks
For new versions of Firefox use the following command:
/Applications/Firefox.app/Contents/MacOS/firefox-bin -P -no-remote &> /dev/null &
source: http://sonnygill.net/mac/mac-multiple-firefox-profiles/
On page explains how to use Automator to create a shortcut.
#dalvan answer does not work any more (10.15)
Workaround I've found is:
run first firefox instance as normal (profile chooser window opens, select primary profile)
use an Automator.app or run from shell /Applications/Firefox.app/Contents/MacOS/firefox-bin -P & and choose secondary profile
All links transfered from other applications will be opened in primary profile
Ref. https://bugzilla.mozilla.org/show_bug.cgi?id=1653218
This did work for me for several FF/Beta/Aurora version 10+
http://xulforge.com/blog/2011/07/multiple-firefox-instances-mac/
+ https://superuser.com/questions/37811/how-can-i-change-an-application-icon-in-mac-os-x for the icons ;)

Does the -app command line option work properly in Firefox 4?

I have written some software that makes use of the -app command line option in Firefox to launch XUL applications in Firefox's embedded copy of XULRunner. This all worked fine in Firefox 3.x, however when I try with Firefox 4, Firefox either crashes or does nothing (depending on if it is on Mac or Windows).
I have tried a number of other command line options and many of them seem to be variously broken. (such as -v to print the version information, which crashes on OSX)
Does anyone know if there are already registered bugs about this? Was the removal of -app intentional or was it an oversight? Is there any way to work around this problem?
The -app is maintained in firefox 4 and should work.
I do not know if there is a bug for windows and mac os, but I'm using it on linux for several apps, and it works well (my firefox version is Mozilla Firefox 4.0.1)
Just wanted to bump this - as on Firefox 7, -app does not seem to be there:
$ uname -s -r
Linux 2.6.38-11-generic
$ firefox --version
Mozilla Firefox 7.0.1
$ firefox --help
Usage: firefox [ options ... ] [URL]
where options include:
X11 options
--display=DISPLAY X display to use
--sync Make X calls synchronous
--g-fatal-warnings Make all warnings fatal
Firefox options
-h or -help Print this message.
-v or -version Print Firefox version.
-P <profile> Start with <profile>.
-migration Start with migration wizard.
-ProfileManager Start with ProfileManager.
-no-remote Open new instance, not a new window in running instance.
-UILocale <locale> Start with <locale> resources as UI Locale.
-safe-mode Disables extensions and themes for this session.
-jsconsole Open the Error console.
-browser Open a browser window.
-new-window <url> Open <url> in a new window.
-new-tab <url> Open <url> in a new tab.
-preferences Open Preferences dialog.
-search <term> Search <term> with your default search engine.
-private Enable private browsing mode.
-private-toggle Toggle private browsing mode.
-setDefaultBrowser Set this app as the default browser.
-g or --debug Start within debugger
-d or --debugger Specify debugger to start with (eg, gdb or valgrind)
-a or --debugger-args Specify arguments for debugger
I too would love to know when and why it was removed, but I simply cannot find any info online (see also Single-file app with xulrunner - possible?) ...
PS: Just filed a bug here: Bug #880596 in firefox (Ubuntu): “Option '-app' missing from Firefox above version 3” - I thought it would be automatically copied to mozilla's bugzilla (seeing bugs like Bug #207454), but unfortunately, it wasn't so... - bugzilla bug needs to be copied and added manually, it's there now...
I also experienced problems using the -app switch. I'm using Firefox 10, but I have an idea this problem goes right back to FF 4.
The firefox binary, when run with the -help option, does not show list the -app option, which caused me much confusion, but I believe its still there.
The problem for me, instead, was to do with this change in Firefox 4, requiring a chrome manifest file in the application root. Since FF 4, only a single (root) chrome manifest is read, so you must create one with the following line, (or lines, if you want to have multiple manifests).
manifest chrome/chrome.manifest
Then launch the application the usual way
firefox -app path/to/application.ini -jsconsole
(For debugging use the -jsconsole option).
Another note, (you didn't mention having tried this, but I did and it was wrong) -- don't use the -no-remote option. I tried this with the intent of starting a new process for my XUL application separate from already running firefox instances. However, the -app option will create a new process for your application even if firefox instances are already running, so there is no need.
See also this question for more info about the chrome manifest issue.

Install Firefox extension using windows registry

I have followed the instructions here [MDC - Adding Extensions using the Windows Registry],
but haven't been able to get Firefox to automatically install my extension when I restart it.
I have written an application that is half windows service and half FF extension. I have built an installer and want it to be able to install the Firefox extension along with the service.
So far I have tried the following things:
Removing my dev version of the
extension from FF first
Removing the
pointer file to my dev version of the
extension from my profile dir
Removing my "dev" profile completelly
so that FF only has a "default"
profile
Running FF without the
-no-remote and -P switches I setup for the dev environment
Trying the
key in both HKEY_CURRENT_USER and
HKEY_LOCAL_MACHINE
Carefully checking
the ID and Paths I have used
Trying
Paths that don't include spaces
Trying the Paths in Quotes
Trying a
trailing \ at the end of the path
Trying the .xpi filename at the end of the path instead of just the dir name
Building the XPI using the Extension
Builder plugin instead of manually
(although my manual build would
install just fine if I dragged it to
FF)
I'm using FF3.5.2 on Windows 2003 Server
(could it be a W2K3 install security issue?)
UPDATE: Now tested also on WinXP FF3.0.11. Same problem.
OK. I figured it out myself! I miss-read one line of the instructions!!!
"the location of the unpacked XPI"
I must be losing my mind. For some reason I reread this as the "packed XPI" over and over!!!
(I feel very silly now)
The answer was to use the unpacked files in the install dir not the .xpi file.
I noticed that it's really important to have back-slash in the file path, ex: [TARGETDIR]Extension\Firefox\

Resources