In general, you should use feature detection via
if (navigator.share) {
// Web Share is available.
}
before attempting to use the Web Share API. Detection based on navigator.userAgent
string matching is not a good idea.
As for the actual error you're reporting, it doesn't necessarily sound like it's coming from the usage of the Web Share API, as none of the code in your snippet actually calls an apply()
method on anything. You should take a look at the stack trace associated with the exception and figure out what underlying code is actually calling apply()
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…