HTML新的 规范影响,Firefox改变添加搜索引擎的方法
2021-04-10 10:09:04

据 Ghacks 报导,近日有 Firefox 用户反映,在使用irefox 65 Nightly 尝试从Mycroft Project、Mozilla AMO 或其它支持的站点安装搜索引擎时,发现该功能不再可用。以往用户想要添加不同搜索引擎时,只需要在 ”Add Search Engine“ 中将其添加到搜索引擎列表中,然而在 Firefox Nightly 中这一操作没有任何响应。

Mozilla 解释,根据 HTML 规范,IE 派生的 window.external 对象将保留,但 AddSearchProvider 和 IsSearchProviderInstalled 方法将不执行操作,而只返回 undefined。站点使用 AddSearchProvider() 方法来实现搜索引擎添加功能,所以这导致了 Firefox 65 Nightly 该功能失效。

The IE-derived window.external object will remain, but the AddSearchProvider and IsSearchProviderInstalled methods on it will be no-op, simply returning undefined, according to the latest HTML spec. This change has also been made to Firefox 65 Nightly.

While AddSearchProvider could be used to add an OpenSearch plug-in to the browser, IsSearchProviderInstalled was always returning 0 on Firefox.

今后 AddSearchProvider 可用于向浏览器添加 OpenSearch 插件,但 IsSearchProviderInstalled 总是在 Firefox 上返回 0。这一变化不会影响 Firefox 的自动发现功能,浏览器会自动选择开放搜索引擎,但前提是它们使用了特定格式。