fix up code to not be webkit-specific

Works on at least Firefox nightlies now...