开发者

Check webkit version with javascript embedded pywebkitgtk?

开发者 https://www.devze.com 2023-03-26 05:05 出处:网络
Apparently the best way to check the version of webkit is /AppleWebKit\\/([\\d.]+)/.exec(navigator.userAgent)

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

精彩评论

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