【发布时间】:2020-09-24 11:50:36
【问题描述】:
我有一些这样的代码:
if (navigator.share) {
navigator.share({
title: 'example',
url: 'http://example.com',
});
}
根据this documentation for navigator.share on MDN,桌面浏览器不支持Web Share API,并且navigator.share在这些浏览器中是未定义的。
但是,当我在桌面 Firefox 中运行此代码时,navigator.share 被定义并设置为一个在调用时似乎没有任何作用的函数。
【问题讨论】: