Showing posts with label Firefox. Show all posts
Showing posts with label Firefox. Show all posts

29 Jan 2010

Civilization -- Freeciv as Browser Game (canvas / SVG)

Yay the joy, I have just discovered that Freeciv is now available as SVG / canvas game.

A browser game with reasonable performance (when using a modern browser) and this game is using open web standards.

From some tests ... FF 3.x on a fast computer is pretty laggy, but FF 3.5+ is very responsive. it feels like an X11 app over a not so fast connection. I am sure this will improve once the javascript implementations gain more performance and the canvas tag matures. After some webgames, this technology seems to be much more capable for games than html, css and javascript alone. Maybe a mix of canvas and html could bring some performance boost.

Freeciv.net seems to perform well on safari, chrome (et all), opera and firefox (< 3.5 recommended) but does not work well on IE8 (unusable, older IE versions are worse).

NOTE:
Chrome and Chromium users can use the --kiosk switch to start the browser in fullscreen mode (not well documented), example:
$ chromium --kiosk http://freeciv.net

Unfortunately on my gnome installation I cannot switch to other windows while chromium is running in fullscreen mode :-/









1 Nov 2009

Firefox profile on NFS

Firefox has switched to sqlite3 for some files in the profile. this happened some time ago (AFAIKT it was with FF3). This is quiet bad if you happen to mount your home via NFS, because sqlite is not designed to work well over NFS (locking problems). The sqlite FAQ(5) has this to say about sqlite databases on NFS:

SQLite uses reader/writer locks to control access to the database. (Under Win95/98/ME which lacks support for reader/writer locks, a probabilistic simulation is used instead.) But use caution: this locking mechanism might not work correctly if the database file is kept on an NFS filesystem. ...
And indeed, it does not work for me (debian/ubuntu). The problem is, that bookmarks, history and other things will be corrupt after a network outage or a firefox crash (hello flash, i am looking at you!). I have not found a solution yet, therefore before starting firefow, I will backup all sqlite Databases:

First, you need to install the sqlite3 utility:
$ sudo apt-get install -y sqlite3


in your .profile, declare the following variables:
export PROFILE="myprofilename"
export FIREFOX_PROFILE_DIR=~/.mozilla/firefox
#export FIREFOX_PROFILE_DIR=~/.mozilla/firefox-3.5


Then use the following script to launch firefox:
#!/bin/bash

if [[ -z "$PROFILE" ]]; then
export PROFILE="default"
fi

if [[ -z "$FIREFOX_PROFILE_DIR" ]]; then
export FIREFOX_PROFILE_DIR=~/.mozilla/firefox
fi

# install sqlite 3: sudo apt-get install -y sqlite3
find=$(which find);
sqlite3=$(which sqlite3);

msg="missing or not in \$PATH, aborting";
if [[ -z "$find" ]]; then echo "find $msg"; exit 1; fi
if [[ -z "$sqlite3" ]]; then echo "sqlite3 $msg"; exit 1; fi

for d in $($find $FIREFOX_PROFILE_DIR/ -maxdepth 1 -type d); do

profile=$(echo "$d" | sed -e 's|.*/[^\.]\+\.||')

# remove this conditional statement, if you want all FF profiles backed up.
# sqlite databases in use are locked.
if [[ "$profile" != "$PROFILE" ]]; then
continue;
fi

echo "$profile | $d";

for f in $(find "$d" -iname "*.sqlite"); do
f=$(echo "$f" | sed -e 's/\.sqlite$//; s|.*/||')
if [[ -f "$d/$f.bak.sql" ]]; then rm "$d/$f.bak.sql"; fi
$sqlite3 $d/$f.sqlite .dump > $d/$f.bak.sql
done

done

firefox-3.5 -P $PROFILE

exit 0;