Skip to content

Error: Permission denied to access property "then" for Firefox Extensions #1710

@limdingwen

Description

@limdingwen

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

It doesn't seem to work in Firefox Extensions. Both Manifest v2 and v3 are tested.

This error is created:

Error: Permission denied to access property "then"

Please see screenshots for the stacktrace; I can't seem to copy it.

To Reproduce

const supabase = createClient(supabaseUrl, supabaseKey);

Expected behavior

It is initialized.

Screenshots

Screenshot 2024-03-13 at 2 15 47 AM

System information

  • OS: macOS
  • Browser: Firefox (web-ext)
  • Version of supabase-js: 2.39.8
  • Version of Node.js: 21.6.1

Additional context

It seems to be something to do with Firefox's XRay Vision. I heard it works in Chrome extensions.

According to this old bug report:

That usually means that you're not creating the Promise out of the right window object. Eg. in chrome JS, don't pass a |new Promise()| to content, but get the window object for the page and do |new pageWindow.Promise()|

Probably something to do with globalThis?

Metadata

Metadata

Assignees

No one assigned

    Labels

    auth-jsRelated to the auth-js library.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions