fix up code to not be webkit-specific