Skip to main content
Question

Firefox configuration method if CCK does not work?

  • August 4, 2015
  • 7 replies
  • 29 views

Forum|alt.badge.img+4

I have found myself today being tasked with distributing Firefox with a default home page of our own set. It seems that, until this very release (39) there was a standard way to do this via CCK.

Can anyone point me in the direction of how people are configuring Firefox now that it appears this is being deprecated? I thought I was free of Firefox, but due to Chrome hating plugins, and me, it seems, I will never be free.

7 replies

Forum|alt.badge.img+14
  • Contributor
  • August 4, 2015

current discussion

Greg Neagle has a nice writeup in one of the recent MacTech's (#350) as well.

edit: Apologies, you are explicitly asking for alternate methods. Will need to revisit this thread if/when current workflows break. We've got until ESR45 it would seem ... so a few weeks. :)


Forum|alt.badge.img+15
  • Esteemed Contributor
  • August 4, 2015

We set the Safari homepage via a script. I then run the following script which sets the Firefox homepage to match Safari. You could easily modify the script and set the $HomePage variable directly instead of pulling it from Safari like I do.

#!/bin/bash

# Get Safari HomePage
HomePage=`defaults read /Users/$3/Library/Preferences/com.apple.Safari HomePage`
if [ -z "$HomePage" ]; then
    echo "No Safari HomePage found"
    exit 0
fi
echo Safari HomePage is $HomePage

# Check for Firefox profile and create if needed
if [ ! -f /Users/$3/Library/Application Support/Firefox/profiles.ini ]; then
    mkdir /Users/$3/Library/Application Support/Firefox
    mkdir /Users/$3/Library/Application Support/Firefox/Profiles
    mkdir /Users/$3/Library/Application Support/Firefox/Profiles/6ijtz7da.default
    echo "[General]" >> /Users/$3/Library/Application Support/Firefox/profiles.ini
    echo "StartWithLastProfile=1" >> /Users/$3/Library/Application Support/Firefox/profiles.ini
    echo "" >> /Users/$3/Library/Application Support/Firefox/profiles.ini
    echo "[Profile0]" >> /Users/$3/Library/Application Support/Firefox/profiles.ini
    echo "Name=default" >> /Users/$3/Library/Application Support/Firefox/profiles.ini
    echo "IsRelative=1" >> /Users/$3/Library/Application Support/Firefox/profiles.ini
    echo "Path=Profiles/6ijtz7da.default" >> /Users/$3/Library/Application Support/Firefox/profiles.ini
    chown -R $3 /Users/$3/Library/Application Support/Firefox
    echo "Firefox profile created"
fi

# Get Firefox profile path
ProfileName=`grep -m 1 "Path=" /Users/$3/Library/Application Support/Firefox/profiles.ini | cut -d '=' -f2`

# Remove existing browser.startup.homepage line(s)
if [ -f /Users/$3/Library/Application Support/Firefox/$ProfileName/prefs.js ]; then
    sed -i '' '/"browser.startup.homepage"/ d' /Users/$3/Library/Application Support/Firefox/$ProfileName/prefs.js
    echo "Existing browser.startup.homepage line(s) removed"
fi

# Set Firefox HomePage
touch /Users/$3/Library/Application Support/Firefox/$ProfileName/prefs.js
echo "user_pref("browser.startup.homepage", "$HomePage");" >> /Users/$3/Library/Application Support/Firefox/$ProfileName/prefs.js
echo "Firefox browser.startup.homepage set to $HomePage"

Forum|alt.badge.img+16
  • Valued Contributor
  • August 4, 2015

You can actually manually configure a number of Firefox settings by creating/editing the following files.

/Applications/Firefox.app/Contents/Resources/browser/override.ini
/Applications/Firefox.app/Contents/Resources/browser/defaults/profile/bookmarks.html
/Applications/Firefox.app/Contents/Resources/mozilla.cfg /Applications/Firefox.app/Contents/Resources/defaults/pref/autoconfig.js

autoconfig.js & mozilla.cfg can actually have any names but the .js has to specify the .cfg file, what you will also find is that there are a bunch of settings that CCK can change (as a full plugin that does it on the fly) that are either unavailable through normal config.

I did at one point manage to find an enormouse list of available options but lost it during one of my many config attempts (doh!), if I locate it again I will post.
I started here though.
https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment

In the end CCK worked better for our needs so I reverted back to that (I think I got stuck on trying to make the bookmarks tool bar always visible and ran out of time).


Forum|alt.badge.img+12
  • Contributor
  • August 5, 2015

Always used the mozilla.cfg and supporting files to set Firefox prefs. Personally haven't had a need to move to CCK.


Forum|alt.badge.img+10
  • New Contributor
  • August 5, 2015

You sure the CCK doesn't work with 39? Do you have CCK 2.1.1?


Forum|alt.badge.img+16
  • Valued Contributor
  • August 5, 2015

@sean I am actually considering moving away from CCK because I like to pass out just pieces of the config as required and got most of the way there the last time I looked.
I don't suppose you happened to set the bookmarks toolbar to display by default and have the entry and file you put it in available?


Forum|alt.badge.img+12
  • Contributor
  • August 6, 2015

Sorry no. Default homepage, lock updates and a couple of other bits. However, if you type about:config into the URL bar you can see any settings that have been set and use this info to work out what you require.