首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在firefox插件中检测firefox android?

在firefox插件中检测firefox android?
EN

Stack Overflow用户
提问于 2017-12-17 17:54:24
回答 0查看 167关注 0票数 0

在Firefox Quantum之前,我可以用下面的代码片段在firefox插件中检测到firefox android。

代码语言:javascript
复制
const { Cc, Ci } = require('chrome');
/**
  * Is firefox android?
  *
  * @returns {boolean} true if there is firefox android in firefox addon
  * @see https://developer.mozilla.org/en-US/Add-ons/Firefox_for_Android/Code_snippets#Supporting_both_desktop_and_mobile
  */
module.exports = () =>
Cc['@mozilla.org/xre/app-info;1']
  .getService(Ci.nsIXULRuntime)
  .widgetToolkit.toLowerCase() === 'android';

但是现在,这段代码被归档了。如何检测这一点?

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47853962

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档