Skip to content

isBrowser check erroneously passes for electron-link bundled node applications #436

@themadtitanmathos

Description

@themadtitanmathos

azure-devops-node-api version: 10.2.1

Issue Description

global.window gets set in electron-link bundled applications, but global.window.navigator won't exist because it isn't a browser app, it's a node app. This means the current isBrowser check isn't quite enough, and the WebApi constructor will fail while trying to set the userAgent by accessing an undefined window.navigator.userAgent. I think a simple fix would be to also check window.navigator exists when calculating isBrowser.

Expected behaviour

isBrowser should not be true for electron-link (or any electron bundled) node apps.

Actual behaviour

isBrowser is true for electron-link (or possibly other electron bundled) node apps.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions