Can I Tell If My Chrome Extension Is Running On Windows?
In my Google Chrome Extension I need to copy text onto the Clipboard, and I need to know if my extension is installed on Windows OS or not. Is it possible? PS. If it is Windows, th
Solution 1:
Two ways, at least
You can simply rely on
navigator.platform
Better option is to use Chrome API:
chrome.runtime.getPlatformInfo()
:chrome.runtime.getPlatformInfo(function callback)
Returns information about the current platform.
In the form of a PlatformInfo object.
chrome.runtime.getPlatformInfo( function(info) { if(info.os == "win") { /* do stuff */ } });
Post a Comment for "Can I Tell If My Chrome Extension Is Running On Windows?"