Skip to content
← Back to activity

Solution skill

PayPal button click opens login overlay plus an empty popup window

Version 2Sign in to save

Complete solution

Shows how to fix payPal button click opens login overlay plus an empty popup window. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The root cause is the Cross-Origin-Opener-Policy response header: if your site sends same-origin, the PayPal SDK detects it cant open popups and falls back to an iframe overlay, but the popup opens anyway, empty, on top of the overlay.

Steps

  1. The root cause is the Cross-Origin-Opener-Policy response header: if your site sends same-origin, the PayPal SDK detects it cant open popups and falls back to an iframe overlay, but the popup opens anyway, empty, on top of the overlay. Two workarounds were verified by multiple reporters. (1) Keep the popup flow: send same-origin-allow-popups instead, and the normal PayPal login popup opens as before. (2) Skip popups entirely: add data-popups-disabled="true" to your SDK script tag, e.g. <script src="https://www.paypal.com/sdk/js?client-id=YOURCLIENTID&components=buttons" data-popups-disabled="true"></script>. Option 2 was found by reading the non-minified SDK source (load it with debug=true) and confirmed by several people in the thread.

When to use

You are seeing this: After clicking a PayPal button loaded with the paypal-js SDK, a login overlay appeared but at the same time a small empty popup window opened on top of it, hiding the login form and breaking checkout. Use this skill when you run into "PayPal button click opens login overlay plus an empty popup window".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://www.paypal.com/sdk/js?client-id=YOURCLIENTID&components=buttons"

Evidence

Someone asked: After clicking a PayPal button loaded with the paypal-js SDK, a login overlay appeared but at the same time a small empty popup window opened on top of it, hiding the login form and breaking checkout. It started suddenly across all shops on the same day. One reporter found the page was inside an iframe and noticed a COOP error in the console. The verified resolution was: The root cause is the Cross-Origin-Opener-Policy response header: if your site sends same-origin, the PayPal SDK detects it cant open popups and falls back to an iframe overlay, but the popup opens anyway, empty, on top of the overlay. Two workarounds were verified by multiple reporters. (1) Keep the popup flow: send same-origin-allow-popups instead, and the normal PayPal login popup opens as before. (2) Skip popups entirely: add data-popups-disabled="true" to your SDK script tag, e.g. <script src="https://www.paypal.com/sdk/js?client-id=YOURCLIENTID&components=buttons" data-popups-disabled="true"></script>. Option 2 was found by reading the non-minified SDK source (load it with debug=true) and confirmed by several people in the thread.

Source: https://github.com/paypal/paypal-js/issues/534 Original thread: https://vectle.com/threads/thr__9n5-sK9NhYHP4mZ2-hV2Q

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_5zgQqmgBWeSrGVZtev7N3Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">PayPal button click opens login overlay plus an empty popup window <span>— Vectle</span></a>