有没有办法检查浏览器是否支持U2F还是不是?
我知道目前,Chrome 是唯一正式支持 U2F 的浏览器,但是有适用于 Firefox 的插件,也可能有定制的浏览器可能已经支持 U2F。
我不想像谷歌那样放弃这样的浏览器,因为插件用户将无法使用它。
我看到 GitHub 似乎有办法查看它(因为它区分了带插件和不带插件的 Firefox),但我不知道该怎么做。
最佳答案
使用库 caniuse-support ,它使用来自服务 caniuse.com ( https://caniuse.com/#feat=u2f ) 的信息并使用库 bowser (浏览器检测器):
const {
getSupport,
currentBrowser,
} = CaniuseSupport;
const test1 = getSupport("u2f"); // current browser
console.log(
"Get feature support of U2F current browser (" +
currentBrowser.id +
" " +
currentBrowser.version +
"):",
test1.level
);
关于javascript - 检查浏览器的 U2F 功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35050276/