Freemius / freemius-checkout-js

Freemius Checkout JS, without jQuery or other dependencies, written in TypeScript as ES Modules.
https://freemius.com/help/documentation/selling-with-freemius/freemius-checkout-buy-button/
MIT License
8 stars 1 forks source link

Checkout not working on Safari #2

Closed jaspervriends closed 2 years ago

jaspervriends commented 2 years ago

It seems that the checkout doesn't work on Safari.

The checkout loads, but then becomes invisible or freezes as there's a visibility: hidden that does not change to visible when loaded.

In Safari we receive an error which comes after the loaded event:

[Error] SecurityError: Blocked a frame with origin "https://app.buttonizer.io" from accessing a cross-origin frame. Protocols, domains, and ports must match.
 (anonymous function) — main.3fe810cc.js:45340:142

The demo page of this package has the same issue in Safafi.

The original Freemius checkout.js does work without any issues in Safari though

swashata commented 2 years ago

Hi @jaspervriends Thanks for reporting this issue. I have figured the cause that listening to the iFrame load event from the parent doesn't work in Safari (for good reasons too I believe). However, Freemius Checkout already emits an event loaded from the inside. So I already have a fix at hand and will push a new version soon (along with a major refactor to make the codebase more managable).