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

Wrap script in async function to fix "await is only valid in async functions" error #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

azrogers
Copy link

Fixes #30.

On Firefox (and maybe other browsers) the script currently gives an Uncaught SyntaxError: await is only valid in async functions, async generators and modules error when run. Wrapping the script in an async closure fixes this.

@fbal98
Copy link

fbal98 commented Sep 1, 2024

Awsome, this should be merged IMO!

@Sebazzz
Copy link

Sebazzz commented Nov 23, 2024

In addition, Firefox does not support the experimental API navigator.userAgentData but you can just set ua to an empty string ("") and it works fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught SyntaxError: await is only valid in async functions, async generators and modules
3 participants