我正在尝试使用 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/