# How can I have Gallery view AND login at the same time with the Web SDK?

**URL:** <https://devforum.zoom.us/t/how-can-i-have-gallery-view-and-login-at-the-same-time-with-the-web-sdk/63743>\
**Category:** Web\
**Created:** [February 3, 2022, 7:28pm UTC](https://devforum.zoom.us/t/how-can-i-have-gallery-view-and-login-at-the-same-time-with-the-web-sdk/63743 "2022-02-03T19:28:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felippe](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/felippe/32/33716_2.png) [@Felippe](https://devforum.zoom.us/u/Felippe)\
**Post date:** [February 3, 2022, 7:28pm UTC](https://devforum.zoom.us/t/how-can-i-have-gallery-view-and-login-at-the-same-time-with-the-web-sdk/63743/1 "2022-02-03T19:28:38Z")

</div>

**Description**  
Gallery View requires COOP (Cross Origin Opener Policy) to be “same-origin”.  
Login popup requires COOP to be off, otherwise the popup that opens under the [zoom.us](http://zoom.us) domain is not provided the `window.opener` information that is required for it to confirm the login was successful

How can I have Gallery view AND login at the same time with the Web SDK?

**Browser Console Error**  
If the COOP is set to “same-origin”, the [Zoom.us](http://Zoom.us) popup will try to send a postMessage to `window.opener` but there is no `opener` because the COOP is set to “same-origin”, so this is the error:

```auto
TypeError: Cannot read properties of null (reading 'postMessage')
    at a.value (main.js?v=1.5.0.1811:1)
    at aa (main.js?v=1.5.0.1811:1)
    at vu (main.js?v=1.5.0.1811:1)
    at t.unstable_runWithPriority (main.js?v=1.5.0.1811:1)
    at Yo (main.js?v=1.5.0.1811:1)
    at du (main.js?v=1.5.0.1811:1)
    at tu (main.js?v=1.5.0.1811:1)
    at Qa (main.js?v=1.5.0.1811:1)
    at Fu (main.js?v=1.5.0.1811:1)
    at main.js?v=1.5.0.1811:1

```

**Which Web Meeting SDK version?**  
Knowing the version can help us to identify your issue faster. [e.g. 1.9.9]

**Meeting SDK Code Snippets**  
The code snippets that are causing the error / issue so we can reproduce.

**To Reproduce(If applicable)**  
Deploy (important to be deployed) a version of the demo Web SDK with COOP set to “same-origin” and you will be not be able to log into a meeting that requires login.

**Screenshots**  
Demonstration: [Loom | Free Screen & Video Recording Software](https://www.loom.com/share/fb35034241b94bd78d159a55a1d9b87c)

**Device (please complete the following information):**

- Device: Macbook Pro M1 Max
- OS: macOS 12.0.1
- Browser: Chrome
- Browser Version 96.0.4664.110

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [February 4, 2022, 4:11am UTC](https://devforum.zoom.us/t/how-can-i-have-gallery-view-and-login-at-the-same-time-with-the-web-sdk/63743/2 "2022-02-04T04:11:35Z")

</div>

Greetings, @Felippe,

Thank you for posting on the Developer Forum. For the behavior you are facing, the solution ultimately will be contingent on what’s best for your environment. There are a few approaches you can take into consideration to accomplish your goal. First, have you tried to leverage the `same-origin-allow-popups` directive? It seems this directive was designed to address the behavior you are experiencing. For context, here is a [feature request](https://chromestatus.com/feature/5731309970259968) on the `COOP same-origin-allow-popups-plus-coep ` for reference.

 ![Screen Shot 2022-02-03 at 10.43.04 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/c/5/c5b1a1df2d99461fae34674c9dc016ed881707a8.png)

# Cross-Origin-Opener-Policy:

> **[Cross-Origin-Opener-Policy (COOP) header - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Opener-Policy)**
>
> The HTTP Cross-Origin-Opener-Policy (COOP) response header allows a website to control whether a new top-level document, opened using Window.open() or by navigating to a new page, is opened in the same browsing context group (BCG) or in a new...

# \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Another approach you can consider implementing is the `coi-serviceworker` from [Github](https://github.com/gzuidhof/coi-serviceworker). This recommendation along with several other approaches can also be found in our how to improve performance for the Web Meeting SDK in Chrome and Edge help documentation as well :

> **[GitHub - gzuidhof/coi-serviceworker: Cross-origin isolation (COOP and COEP) through a...](https://github.com/gzuidhof/coi-serviceworker)**
>
> Cross-origin isolation (COOP and COEP) through a service worker for situations in which you can't control the headers (e.g. GH pages)

# Improve performance for the [Web Meeting SDK](https://marketplace.zoom.us/docs/sdk/native-sdks/web) and [Web Video SDK](https://marketplace.zoom.us/docs/sdk/video/web) in Chrome and Edge.

[https://marketplace.zoom.us/docs/sdk/overview/improve-performance/](https://marketplace.zoom.us/docs/sdk/overview/improve-performance/)

You may also consider implementing a [custom CORS policy provider](https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/enabling-cross-origin-requests-in-web-api#custom-cors-policy-providers) so you can filter requests on a one-by-one basis.

I hope this helps to clarify your concern.

Best,  
Donte

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [March 6, 2022, 2:11pm UTC](https://devforum.zoom.us/t/how-can-i-have-gallery-view-and-login-at-the-same-time-with-the-web-sdk/63743/3 "2022-03-06T14:11:50Z")

</div>

Closed on March 6, 2022, 2:11pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
