[Sorry, I myself have not tried any of these, and I am only trying to provide pointers.]
There is no generic solution for any browser I think. Also I don't think this is possible via a client script. With whatever research I did I could come up with
this one[
^] for Firefox
and
this one[
^] for Chrome.
Also see this
SO thread[
^] that suggests some frameworks for such things.
Hope it helps.