Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this navigator.userAgent expected? #20079

Closed
loynoir opened this issue Aug 6, 2023 · 1 comment · Fixed by #20129
Closed

Is this navigator.userAgent expected? #20079

loynoir opened this issue Aug 6, 2023 · 1 comment · Fixed by #20129
Labels
bug Something isn't working correctly good first issue Good for newcomers web related to Web APIs

Comments

@loynoir
Copy link

loynoir commented Aug 6, 2023

Within Deno Worker

  self.postMessage([null, typeof navigator])
  self.postMessage([null, typeof navigator.userAgent])
[ null, "object" ]
[ null, "undefined" ]

This breaks the browser-or-node assumption

https://github.com/flexdinesh/browser-or-node/blob/master/src/index.js#L20-L21

What does the spec say about Worker navigator.userAgent?

Is this expected?

Related flexdinesh/browser-or-node#26

@bartlomieju
Copy link
Member

According to https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator it should be available, so it's a bug on our side.

@bartlomieju bartlomieju added bug Something isn't working correctly web related to Web APIs good first issue Good for newcomers labels Aug 6, 2023
bartlomieju added a commit that referenced this issue Aug 15, 2023
Fixes #20079

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
littledivy pushed a commit to littledivy/deno that referenced this issue Aug 21, 2023
Fixes denoland#20079

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
littledivy pushed a commit that referenced this issue Aug 21, 2023
Fixes #20079

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly good first issue Good for newcomers web related to Web APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants