javascript - phantomJS 是否支持地理定位?

标签 javascript phantomjs qunit chutzpah

我正在尝试使用 PhantomJS 运行 qunit 测试用例。当 phantomJS 尝试访问 DOM 的 navigator.geolocation 函数时,我的一项测试挂起。同样的测试在浏览器中运行良好,只是卡在带有 phantomJS 的控制台中。

phantomJS 是否支持地理定位?有什么建议吗?

在以下 if 条件中中断

  if(navigator.geolocation) {
            window.navigator.geolocation.watchPosition(updateLocation, null, { frequency: 3000 });
        }

最佳答案

没有。

只需检查 features.js示例。

>phantomjs.exe features.js
Detected features (using Modernizr 2.0.6):

Supported:
  touch
  generatedcontent
  fontface
  flexbox
  canvas
  canvastext
  postmessage
  websqldatabase
  hashchange
  history
  draganddrop
  websockets
  rgba
  hsla
  multiplebgs
  backgroundsize
  borderimage
  borderradius
  boxshadow
  textshadow
  opacity
  cssanimations
  csscolumns
  cssgradients
  cssreflections
  csstransforms
  csstransitions
  localstorage
  sessionstorage
  webworkers
  applicationcache
  svg
  inlinesvg
  smil
  svgclippaths

Not supported:
  csstransforms3d
  webgl
  geolocation
  indexeddb
  video
  audio

关于javascript - phantomJS 是否支持地理定位?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15894090/

相关文章:

javascript - socket.io 无法在服务器上工作并出现 404 错误

javascript - 使用 jquery 从 bootstrap selectpicker 文本框中获取值

javascript - Qunit 参数化测试和模拟

javascript - 如何编写具有异步设置和拆卸操作的测试?

javascript - 访问 RequireJS 路径配置

javascript - 使用边界框进行碰撞检测会减慢帧速度

javascript - Div 相对于视口(viewport)顶部的位置

html - 通过 PhantomJS 将 HTML 页面转换为 SVG 图像

javascript - CasperJS 无法设置 window.navigator 对象

node.js - 我在 Azure 上有这些模块,为什么我收到 Recipe phantom-pdf was not found.?