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

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

Open
2 tasks done
limdingwen opened this issue Mar 12, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@limdingwen
Copy link

limdingwen commented Mar 12, 2024

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?

@limdingwen limdingwen added the bug Something isn't working label Mar 12, 2024
@limdingwen
Copy link
Author

I realise a possible issue is that I was running it in a content script, not a service worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant