Skip to content

Access to storage is not allowed from this context. #19

@andreademasi

Description

@andreademasi

Trying to use storage.get() in a content script results in Access to storage is not allowed from this context.
Here's my code:

// content.ts

const storage = new Storage({ area: "session" })

const init = async () => {
  value = await storage.get("key")
}

init()

I can't call storage.get() outside an async function so am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions