Skip to content

[Feature] default to top-level-await #2342

Description

@scarf005

Motivation

while it's possible via // @top-level-await (#833), i think this behavior could be default.

Proposed Solution

make this flag the default.

Use Cases

  • it's convenient to await web APIs.
const isIncognito = await navigator.storage.getDirectory().then(() => false).catch(() => true)

(code from Joe12387/detectIncognito#51)

  • less surprises to people new to userscript that expects valid JS syntax to work

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions