views:

77

answers:

1

Because of WebSocket protocol changes in WebKit nightly build r59903, I need to know whether I should run additional scripts. That depends on WebKit build number. I'm using jQuery as a platform, so assume $.browser.webkit is true. Then how do I check whether client WebKit build is 59903 or higher? $.browser.version tells something like 533.17.8, or 533 etc and not build number.

EDIT The problem is that I need to decide whether to run additional stuff preferably at a page load stage (actually, there are two possible scenarios I should choose of). However, I can detect WebSocket protocol changes after a page was loaded (server simply refuses a connection with an unsupported protocol version, and WebSocket object silently closes).

+1  A: 

Build number is a completely arbitrary value, it may jump ahead, change format, and is never part of a release version of WebKit.

Can you not test for the functionality you need or use try/catch and fall back to your "additional scripts" stuff?

ExitToShell
@ExitToShell I've added comment to the question regarding your idea. However, I consider such a solution as the only solution I know.
eigenein