Another, possibly more common, and naive,
mechanism would be to simply sniff the
user agent and compare to a browscap
(Browser Capabilities) database. In this
case passing the user agent header from
a known JavaScript capable browser ought
to work.
--
perl -pew "s/\b;([mnst])/'$1/g"