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.
精彩评论