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

(Firefox extension) Error: Not allowed to define cross-origin object as property on [Object] or [Array] XrayWrapper #8407

Closed
CharlieDigital opened this issue Aug 6, 2024 · 6 comments · Fixed by #8425

Comments

@CharlieDigital
Copy link

CharlieDigital commented Aug 6, 2024

Operating System

Mac M1, macOS 14.5

Browser Version

Firefox 129.0

Firebase SDK Version

10.12.4

Firebase SDK Product:

Auth

Describe your project's tooling

Vue, Vite

Describe the problem

Firebase auth seems to fail at code startup when making a heartbeat call to IndexDB:

image

Error message:

Error: Not allowed to define cross-origin object as property on [Object] or [Array] XrayWrapper

Call is being made from a Vue component injected into a browser page via content script.

The code works fine in Chrome and in Firefox locally against the Firebase emulator in local development.

This failure to connect to the IndexDB appears to then affect the call to signInWithCustomToken at a later juncture in the code (not certain that they are related):

image

Steps and code to reproduce issue

I'm in the process of creating a reproducible sample, but so far I've only observed this with a published extension (everything works fine when working locally and connected to the emulator as it does not care about the referrer).

Chrome version of the extension: https://chromewebstore.google.com/detail/turasapp/lpfijfdbgohlblnadiokliolkkeeblpo

Firefox version: https://addons.mozilla.org/en-US/firefox/addon/turas-app/

Both are non-obfuscated so it should be possible to step through the source in the file maps-connector.js

@CharlieDigital CharlieDigital added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Aug 6, 2024
@jbalidiong jbalidiong added needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels Aug 6, 2024
@CharlieDigital
Copy link
Author

CharlieDigital commented Aug 7, 2024

Follow on error seems to be related to this earlier issue: #7997

Here is the error in Firefox:

Screenshot 2024-08-06 at 10 29 28 PM

Network request is sent and response is received as an HTTP 403 due to empty referrer in the request.

Stack:

Screenshot 2024-08-06 at 11 41 34 PM

@hsubox76 hsubox76 self-assigned this Aug 8, 2024
@hsubox76
Copy link
Contributor

hsubox76 commented Aug 8, 2024

We should never error the user in heartbeats code. We should probably gracefully fail in this case - most likely wrap this call in a try/catch. Maybe we should wrap the entirety of triggerHeartbeat in a try/catch and log the error at debug loglevel.

@hsubox76 hsubox76 added the bug label Aug 8, 2024
@CharlieDigital
Copy link
Author

CharlieDigital commented Aug 8, 2024

@hsubox76 would the failure to access IndexDB then affect the subsequent call to the auth API endpoint (identitytoolkit.google.com)? The <empty> referrer is currently preventing the code from working in FF and I haven't determined yet whether this is definitively related to the failure to IndexDB.

@hsubox76
Copy link
Contributor

hsubox76 commented Aug 9, 2024

No product code depends on heartbeats code, it's independent. Several other products use the native indexedDB API, and if indexedDB has limitations in this environment (firefox extension), then those products may have their own problems, which should be addressed separately.

@CharlieDigital
Copy link
Author

I'll file a separate issue for it then.

@naveedahmed1
Copy link

I am seeing heartbeats undefined waring in dev console after upgrade.

@firebase firebase locked and limited conversation to collaborators Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants