Difference between revisions of "Mozilla Firefox"

From WhyAskWhy.org Wiki
Jump to: navigation, search
m (Added directions for having Mozilla Firefox maximize its window on launch.)
m (Saving progress. I'm attempting to update the page with new details picked up from the last week or so while working with Firefox 46 and 47.)
Line 2: Line 2:
 
[[Category:Browser]]
 
[[Category:Browser]]
 
[[Category:NeedsCleanup]]
 
[[Category:NeedsCleanup]]
 +
 +
== Terminology ==
 +
 +
=== INSTALL_DIR ===
 +
 +
One of:
 +
 +
* <code>C:\Program Files\Mozilla Firefox</code>
 +
* <code>C:\Program Files (x86)\Mozilla Firefox</code>
 +
 +
=== PROFILE_DIR ===
 +
 +
<code>%APPDATA%\Mozilla\Firefox\Profiles\THE_NAME_OF_THE_PROFILE_HERE</code>
 +
 +
=== The "old way" ===
 +
 +
The examples shown for the "old way" are estimated to have been used between Firefox versions 3.6.x and 17 ESR, but it's been long enough now that I don't know for sure.
 +
 +
 +
== Enable old extensions that fail Compatibility Check ==
 +
 +
''Note: I've not tested this approach in many years.''
 +
 +
Unfortunately this has to be done each time a ''major'' version of Mozilla Firefox is released and it is a per-user setting. We'll assume you're running Mozilla Firefox 14 for the purposes of these directions.
 +
 +
# Open Mozilla Firefox
 +
# Type <code>about:config</code> in the address bar.
 +
# Right-click and select '''New'''
 +
# Choose '''Boolean'''
 +
# For the name type <code>extensions.checkCompatibility.14.0</code> and set the value to <code>false</code>
 +
# Close Mozilla Firefox and reopen.
 +
 +
I use this method to enable [https://addons.mozilla.org/en-us/firefox/addon/aardvark/ Aardvark] in recent Mozilla Firefox releases. I may eventually get around to trying [https://addons.mozilla.org/en-US/firefox/addon/hack-the-web/ HackTheWeb] that is supposed to be its successor.
 +
 +
 +
== Display bookmarks toolbar ==
 +
 +
=== The current way ===
 +
 +
The current approach is to set the values within <code>PROFILE_DIR\xulstore.json</code>:
 +
 +
<syntaxhighlight lang="javascript">
 +
{
 +
    "chrome://browser/content/browser.xul":
 +
        {
 +
            "PersonalToolbar":
 +
                {
 +
                    "collapsed":"false",
 +
                    "currentset":"personal-bookmarks"
 +
                }
 +
        }
 +
}
 +
</syntaxhighlight>
 +
 +
=== The old way ===
 +
 +
# Edit <code>PROFILE_DIR\localstore.rdf</code>
 +
# Insert a new line or change an existing line to include the following setting
 +
<syntaxhighlight lang="xml">
 +
  <RDF:Description RDF:about="chrome://browser/content/browser.xul#PersonalToolbar"
 +
                  collapsed="false" />
 +
</syntaxhighlight>
 +
 +
See the [[#Complete_example]] on this page for what a trimmed down, but completely functional file looks like. Not only is this setting illustrated but others as well.
 +
  
 
== Maximize on startup ==
 
== Maximize on startup ==
  
You’d think something like this would be incredibly easy, maybe even be in an options tab or possibly <code>prefs.js</code> in the user's profile.
+
=== The current way ===
 +
 
 +
The current approach is to set the values within <code>PROFILE_DIR\xulstore.json</code>:
 +
 
 +
<syntaxhighlight lang="javascript">
 +
{
 +
    "chrome://browser/content/browser.xul":
 +
        {
 +
            "main-window":
 +
                {
 +
                    "sizemode":"maximized"
 +
                }
 +
        }
 +
}
 +
</syntaxhighlight>
  
Not quote. The setting is in <code>localstore.rdf</code> within the user's profile. This value is supposed to be saved automatically when closing out of the browser, as this page mentions.
+
=== The old way ===
  
In my case I want a lab of users to all receive the same ''maximize window'' setting. Thankfully, the user profile being used is thin and I don't have to worry about them having a personalized <code>localstore.rdf</code> file.
+
==== Snippet ====
 +
 
 +
# Edit <code>PROFILE_DIR\localstore.rdf</code>
 +
# Insert a new line or change an existing line to include the following setting
 +
<syntaxhighlight lang="xml">
 +
  <RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
 +
                  sizemode="maximized" />
 +
</syntaxhighlight>
 +
 
 +
 
 +
== Disable profile migrations ==
 +
 
 +
This is used to turn off the prompt to migrate settings from other browsers on first launch.
 +
 
 +
# Edit or create <code>override.ini</code>
 +
# Insert or update the <code>EnableProfileMigrator</code> value
 +
 
 +
<syntaxhighlight lang="ini">
 +
[XRE]
 +
EnableProfileMigrator=false
 +
</syntaxhighlight>
 +
 
 +
This file can be placed in the following locations:
 +
 
 +
* <code>INSTALL_DIR\browser\override.ini</code>
 +
* <code>PROFILE_DIR\browser\override.ini</code>
 +
 
 +
If you place it in the former directory, it will effect everyone using Firefox for the first time. If the second, it will effect both existing and new Firefox profiles.
 +
 
 +
 
 +
== References ==
 +
 
 +
=== Example config files ===
 +
 
 +
==== Current ====
 +
 
 +
===== <code>PROFILE_DIR\xulstore.json</code> =====
 +
 
 +
Tested and confirmed to work with Mozilla Firefox 46 and 47, this appears to be the way to apply settings to a specific user profile. This file does the following:
 +
 
 +
* Maximizes window on application launch
 +
* Displays the main menu (hidden by default)
 +
* Displays the bookmarks toolbar (hidden by default)
 +
 
 +
 
 +
<syntaxhighlight lang="javascript">
 +
{
 +
    "chrome://browser/content/browser.xul":
 +
        {
 +
            "main-window":
 +
                {
 +
                    "sizemode":"maximized"
 +
                },
 +
            "toolbar-menubar":
 +
                {
 +
                    "autohide":"false"
 +
                },
 +
            "PersonalToolbar":
 +
                {
 +
                    "collapsed":"false",
 +
                    "currentset":"personal-bookmarks"
 +
                }
 +
        }
 +
}
 +
</syntaxhighlight>
 +
 
 +
==== Historical ====
 +
 
 +
===== <code>PROFILE_DIR\localstore.rdf</code> =====
 +
 
 +
Here is a complete copy of the file that I once used for lab environments (where I didn't have to worry with merging in the changes to existing files). Here we're maximizing the window in addition to displaying the bookmarks toolbar.
  
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
Line 17: Line 166:
 
     $HeadURL$
 
     $HeadURL$
 
      
 
      
     Purpose: Set the Firefox window to maximized. This file would be copied
+
     Purpose:  
 +
            #1)
 +
            Set the Firefox window to maximized. This file would be copied
 
             over on every login, thereby preventing the window from coming up
 
             over on every login, thereby preventing the window from coming up
 
             sized smaller. Users are able to size it themselves during their
 
             sized smaller. Users are able to size it themselves during their
 
             browsing session however.
 
             browsing session however.
 +
 +
            #2
 +
            Always show Bookmarks Toolbar
 
-->
 
-->
 
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
 
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
 
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
 
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
 +
  <RDF:Description RDF:about="chrome://browser/content/browser.xul#PersonalToolbar"
 +
                  collapsed="false" />
 
   <RDF:Description RDF:about="chrome://browser/content/browser.xul#sidebar-title"
 
   <RDF:Description RDF:about="chrome://browser/content/browser.xul#sidebar-title"
 
                   value="" />
 
                   value="" />
Line 32: Line 188:
 
     <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-box"/>
 
     <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-box"/>
 
     <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-title"/>
 
     <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-title"/>
 +
    <NC:persist RDF:resource="chrome://browser/content/browser.xul#PersonalToolbar"/>
 
   </RDF:Description>
 
   </RDF:Description>
 
</RDF:RDF>
 
</RDF:RDF>
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Here is the relevant value:
 
 
<syntaxhighlight lang="xml">
 
sizemode="maximized"
 
</syntaxhighlight>
 
 
 
 
== Enable old extensions that fail Compatibility Check ==
 
 
Unfortunately this has to be done each time a ''major'' version of Mozilla Firefox is released and it is a per-user setting. We'll assume you're running Mozilla Firefox 14 for the purposes of these directions.
 
 
# Open Mozilla Firefox
 
# Type <code>about:config</code> in the address bar.
 
# Right-click and select '''New'''
 
# Choose '''Boolean'''
 
# For the name type <code>extensions.checkCompatibility.14.0</code> and set the value to <code>false</code>
 
# Close Mozilla Firefox and reopen.
 
 
I use this method to enable [https://addons.mozilla.org/en-us/firefox/addon/aardvark/ Aardvark] in recent Mozilla Firefox releases. I may eventually get around to trying [https://addons.mozilla.org/en-US/firefox/addon/hack-the-web/ HackTheWeb] that is supposed to be its successor.
 

Revision as of 08:28, 15 June 2016


Terminology

INSTALL_DIR

One of:

  • C:\Program Files\Mozilla Firefox
  • C:\Program Files (x86)\Mozilla Firefox

PROFILE_DIR

%APPDATA%\Mozilla\Firefox\Profiles\THE_NAME_OF_THE_PROFILE_HERE

The "old way"

The examples shown for the "old way" are estimated to have been used between Firefox versions 3.6.x and 17 ESR, but it's been long enough now that I don't know for sure.


Enable old extensions that fail Compatibility Check

Note: I've not tested this approach in many years.

Unfortunately this has to be done each time a major version of Mozilla Firefox is released and it is a per-user setting. We'll assume you're running Mozilla Firefox 14 for the purposes of these directions.

  1. Open Mozilla Firefox
  2. Type about:config in the address bar.
  3. Right-click and select New
  4. Choose Boolean
  5. For the name type extensions.checkCompatibility.14.0 and set the value to false
  6. Close Mozilla Firefox and reopen.

I use this method to enable Aardvark in recent Mozilla Firefox releases. I may eventually get around to trying HackTheWeb that is supposed to be its successor.


Display bookmarks toolbar

The current way

The current approach is to set the values within PROFILE_DIR\xulstore.json:

{
    "chrome://browser/content/browser.xul":
        {
            "PersonalToolbar":
                {
                    "collapsed":"false",
                    "currentset":"personal-bookmarks"
                }
        }
}

The old way

  1. Edit PROFILE_DIR\localstore.rdf
  2. Insert a new line or change an existing line to include the following setting
  <RDF:Description RDF:about="chrome://browser/content/browser.xul#PersonalToolbar"
                   collapsed="false" />

See the #Complete_example on this page for what a trimmed down, but completely functional file looks like. Not only is this setting illustrated but others as well.


Maximize on startup

The current way

The current approach is to set the values within PROFILE_DIR\xulstore.json:

{
    "chrome://browser/content/browser.xul":
        {
            "main-window":
                {
                    "sizemode":"maximized"
                }
        }
}

The old way

Snippet

  1. Edit PROFILE_DIR\localstore.rdf
  2. Insert a new line or change an existing line to include the following setting
  <RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
                   sizemode="maximized" />


Disable profile migrations

This is used to turn off the prompt to migrate settings from other browsers on first launch.

  1. Edit or create override.ini
  2. Insert or update the EnableProfileMigrator value
[XRE]
EnableProfileMigrator=false

This file can be placed in the following locations:

  • INSTALL_DIR\browser\override.ini
  • PROFILE_DIR\browser\override.ini

If you place it in the former directory, it will effect everyone using Firefox for the first time. If the second, it will effect both existing and new Firefox profiles.


References

Example config files

Current

PROFILE_DIR\xulstore.json

Tested and confirmed to work with Mozilla Firefox 46 and 47, this appears to be the way to apply settings to a specific user profile. This file does the following:

  • Maximizes window on application launch
  • Displays the main menu (hidden by default)
  • Displays the bookmarks toolbar (hidden by default)


{
    "chrome://browser/content/browser.xul":
        {
            "main-window":
                {
                    "sizemode":"maximized"
                },
            "toolbar-menubar":
                {
                    "autohide":"false"
                },
            "PersonalToolbar":
                {
                    "collapsed":"false",
                    "currentset":"personal-bookmarks"
                }
        }
}

Historical

PROFILE_DIR\localstore.rdf

Here is a complete copy of the file that I once used for lab environments (where I didn't have to worry with merging in the changes to existing files). Here we're maximizing the window in addition to displaying the bookmarks toolbar.

<?xml version="1.0"?>
<!-- 
    $Id$
    $HeadURL$
     
    Purpose: 
            #1)
             Set the Firefox window to maximized. This file would be copied
             over on every login, thereby preventing the window from coming up
             sized smaller. Users are able to size it themselves during their
             browsing session however.

            #2
             Always show Bookmarks Toolbar
-->
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Description RDF:about="chrome://browser/content/browser.xul#PersonalToolbar"
                   collapsed="false" />
  <RDF:Description RDF:about="chrome://browser/content/browser.xul#sidebar-title"
                   value="" />
  <RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
                   sizemode="maximized" />
  <RDF:Description RDF:about="chrome://browser/content/browser.xul">
    <NC:persist RDF:resource="chrome://browser/content/browser.xul#main-window"/>
    <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-box"/>
    <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-title"/>
    <NC:persist RDF:resource="chrome://browser/content/browser.xul#PersonalToolbar"/>
  </RDF:Description>
</RDF:RDF>