@jancborchardt's commit for cross browser compatibility of extension.