sandbox-worklet
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

sandbox-worklet

Eval untrusted JS in an AudioWorklet inside an unpriviledged iframe.

npm i sandbox-worklet pnpm add sandbox-worklet yarn add sandbox-worklet

API

# SandboxNode

    # constructor(context)
    # rpc

      Rpc

    # eval(code)

      # code

        string

      eval(code)  =>

        any

# create(context)

    # context

      BaseAudioContext

    create(context)  =>

# register(context)

    # context

      BaseAudioContext

    register(context)  =>

      Promise<void>
# Sandbox

    {

    # destroy

      # ()

        ()  =>

          void

# eval

    # (code)

      # code

        string

      (code)  =>

        Promise<any>

# ondestroy

    # ()

      ()  =>

        void

}
# createSandbox()

    createSandbox()  =>

Credits

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas

Readme

Keywords

none

Package Sidebar

Install

npm i sandbox-worklet

Weekly Downloads

18

Version

1.1.0

License

MIT

Unpacked Size

33.8 kB

Total Files

34

Last publish

Collaborators

  • stagas