firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.74k stars 868 forks source link

Cross-Origin-Opener-Policy policy would block the window.closed call. #8213

Open flurryunicorn opened 2 weeks ago

flurryunicorn commented 2 weeks ago

Operating System

Windows 11

Browser Version

124.0.6367.118

Firebase SDK Version

^10.11.1

Firebase SDK Product:

Auth

Describe your project's tooling

React bootstrap app with vite

Describe the problem

I have implemented signIn/signUp using firebase auth. When I try to signIn with email and password, there are no errors consoled. When I try to signInWithGoogle, it was successfully signed in, but it consoled

Cross-Origin-Opener-Policy policy would block the window.closed call.
firebase_auth.js?v=7506f255:6655 

Steps and code to reproduce issue

Here is specific code part in firebase_auth.js that shows the console error:

pollUserCancellation() {
    const poll = () => {
      var _a, _b;
      if ((_b = (_a = this.authWindow) === null || _a === void 0 ? void 0 : _a.window) === null || _b === void 0 ? void 0 : _b.closed) {
        this.pollId = window.setTimeout(
          () => {
            this.pollId = null;
            this.reject(_createError(
              this.auth,
              "popup-closed-by-user"
              /* AuthErrorCode.POPUP_CLOSED_BY_USER */
            ));
          },
          8e3
          /* _Timeout.AUTH_EVENT */
        );
        return;
      }
      this.pollId = window.setTimeout(poll, _POLL_WINDOW_CLOSE_TIMEOUT.get());
    };
    poll();
  }
jbalidiong commented 2 weeks ago

Hi @flurryunicorn, thanks for reaching out to us. I’m able to reproduce the error you mentioned. I’ll raise this to our engineering team to see what we can do here and I’ll update this thread if I have any information to share.

flurryunicorn commented 2 weeks ago

thanks, let me know if you have any update about that issue @jbalidiong

bhparijat commented 1 week ago

Hi, this blog post talks about workaround for getting rid of the error https://stackoverflow.com/questions/76446840/cross-origin-opener-policy-policy-would-block-the-window-closed-call-error-while

google-oss-bot commented 4 days ago

Hey @flurryunicorn. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!