Extensions Submodule > Fetchers > MicrosoftPreview
MicrosoftPreview
- Developer: Microsoft
- BrowserType:
fetcher
User-Agent Examples
sh
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; MicrosoftPreview/2.0; +https://aka.ms/MicrosoftPreview) Chrome/W.X.Y.Z Safari/537.36Code Example
js
import { UAParser } from 'ua-parser-js';
import { Fetchers } from 'ua-parser-js/extensions';
import { Extension } from 'ua-parser-js/enums';
const fetcherParser = new UAParser(Fetchers);
const browser = fetcherParser.setUA('Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; MicrosoftPreview/2.0; +https://aka.ms/MicrosoftPreview) Chrome/W.X.Y.Z Safari/537.36').getBrowser();
console.log(browser);
// {name: "MicrosoftPreview", version: "2.0", major: "2", type: "fetcher"}
// Compare using the built-in enum
const { Fetcher } = Extension.BrowserName;
console.log(browser.is(Fetcher.MICROSOFT_PREVIEW));
// true