diff --git a/Changelog.md b/Changelog.md index a38f62f..8ae99d1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## 2.4.1 - (2021-05-05) + +- Use `self` instead of `window` in order to support web workers. + ## 2.4.0 - 2021-04-19 - Expose `AzureIdentityCredentialAdapter` in the public API to enable users of this package make use of credentials from `@azure/identity`. diff --git a/lib/policies/msRestUserAgentPolicy.browser.ts b/lib/policies/msRestUserAgentPolicy.browser.ts index ec37b93..9b688a4 100644 --- a/lib/policies/msRestUserAgentPolicy.browser.ts +++ b/lib/policies/msRestUserAgentPolicy.browser.ts @@ -18,7 +18,7 @@ export function getDefaultUserAgentKey(): string { } export function getPlatformSpecificData(): TelemetryInfo[] { - const navigator = window.navigator as NavigatorEx; + const navigator = self.navigator as NavigatorEx; const osInfo = { key: "OS", value: (navigator.oscpu || navigator.platform).replace(" ", ""), diff --git a/lib/util/constants.ts b/lib/util/constants.ts index 5437b78..537230d 100644 --- a/lib/util/constants.ts +++ b/lib/util/constants.ts @@ -7,7 +7,7 @@ export const Constants = { * @const * @type {string} */ - msRestVersion: "2.4.0", + msRestVersion: "2.4.1", /** * Specifies HTTP. diff --git a/package.json b/package.json index 80a4f7a..5ed31a2 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "email": "azsdkteam@microsoft.com", "url": "https://github.com/Azure/ms-rest-js" }, - "version": "2.4.0", + "version": "2.4.1", "description": "Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest", "tags": [ "isomorphic",