开发者

Check webkit version with javascript embedded pywebkitgtk?

Apparently the best way to check the version of webkit is

/AppleWebKit\/([\d.]+)/.exec(navigator.userAgent)

(as seen here and a few other places). What is this /AppleWebKi开发者_开发知识库t/, a hidden variable, a constant, a regex?

I noticed it worked fine in the browser, but would not work in an embedded pywebkitgtk, it returns null. Is there something missing in the embedded webkit?


/AppleWebKit/([\d.]+)/ is a regular expression which navigator.userAgent is checked against.

The navigator object returns information about the browser you use (name, version, etc). So I guess this does not exist in pywebkitgtk, as it's only a framework for WebKitGtk, not a browser by itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜