Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect operating system from Google Chrome Extension

I am developing a Chrome extension, and I need to detect which operating system Chrome is running on but i can't seem to find any info on how to do it. Please Help. Thank You.

like image 539
Roberto Avatar asked Jun 16 '11 18:06

Roberto


People also ask

What operating system does Chrome run on?

Google Chrome OS is an open source lightweight operating system (OS). It uses one-sixtieth as much hard drive space as Windows 7 and is intended for netbooks or tablet PCs that access Web-based applications and stored data from remote servers. The Chrome OS is so lean that boot time is about seven seconds.

Can Chrome extensions be detected?

“Chrome extensions can be detected by fetching their web-accessible resources — the files inside an extension that web pages can access,” z0ccc explained. “The detected extensions can be used to track you through browser fingerprinting.”

How do I check the version of my extension?

Head over to the extensions page in the Chrome web store. In the Additional Information section you will find what is the latest version pushed by the developer and when it was done.

How do I know if Chrome extensions are installed?

On your computer, open Chrome . At the top right, click Extensions .


2 Answers

Recently added, you can use the getPlatformInfo method in Chrome's own API:

chrome.runtime.getPlatformInfo(function(info) {
    // Display host OS in the console
    console.log(info.os);
});
like image 127
sergiokas Avatar answered Sep 23 '22 17:09

sergiokas


You would need to search for OS name and version inside window.navigator.appVersion.

If you just want to know a platform, see this answer. You can enhance the code by searching for other user agents.

Here is a detailed list of Chrome user agent strings (click on links to see what they mean).

like image 38
serg Avatar answered Sep 23 '22 17:09

serg