Liz Yang
Liz Yang

Reputation: 18

Is there a method to output the version of chrome in the console?

I want to check out the version of chrome in such an easy way with the browser's debugger tool.

Upvotes: 0

Views: 455

Answers (1)

user94559
user94559

Reputation: 60153

navigator.userAgent gives you that data (among other things in the user agent string).

To get just the Chrome version, try this:

navigator.userAgent.match(/Chrome\/(\S*)/)[1]

Upvotes: 4

Related Questions