In all previous slacko versions I did not bother limiting the browser cache. The only way I knew how to do it was to install a default profile in /root/.mozilla. If you decide to run the browser as spot then this totally defeats the purpose.
Mozilla in their infinite wisdom has decided to remove that option from it's gui preferences program. . The only way to do it now is manually through about:config.
With a bit of research I devised a way to limit the browser cache without installing a default profile.
A file; /usr/lib/firefox*/defaults/preferences/local-settings.js needs to be created (you can check it out at /usr/lib/firefox-17.0.11/defaults/preferences). It contains the following:
Code: Select all
//
//default home page and cache
pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=file:///usr/share/doc/home.htm");
pref("browser.cache.disk.capacity", 60000);
The trick about this though was how to implement it without hard coding?
Well I did this at the woof level with a pinstall.sh. The relevant part of the pinstall.sh contains this:
Code: Select all
# work around for firefox bug to set cache
if [ `pwd` != '/' ];then
FF=$(find usr/lib -type d -name firefox*)
PKGSTATDIR=`find ../../ -type d -name status -maxdepth 3`
PKGSTATFILE=`find $PKGSTATDIR -type f -name 'findpkgs_FINAL_PKGS*'`
FFVER=`grep 'firefox' $PKGSTATFILE | awk -F'|' '{print $6}'`
FFVER=${FFVER%%.*}
if [ "$FFVER" -ge 21 ];then
mkdir -p ${FF}/browser/defaults/preferences
PREFDIR="${FF}/browser/defaults/preferences"
else
mkdir -p ${FF}/defaults/preferences
PREFDIR="${FF}/defaults/preferences"
fi
cat > ${PREFDIR}/local-settings.js <<_EOF
//
//default home page and cache
pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=file:///usr/share/doc/home.htm");
pref("browser.cache.disk.capacity", 60000);
_EOF
fi
This should work for seamonkey as well but the version change over would have to be noted.
Many thanks to Mike's Musings.