Get rid of non-standard function (not in Safari)

Thanks to @mgold for reporting!