question

araja avatar image
araja asked Rohit Bhardwaj commented

Browser errors in clover hosted iframe application

I am trying to implement ecommerce application using Clover iFrame Integration explained here.

https://docs.clover.com/docs/using-the-clover-hosted-iframe


But when I run my webpage on firefox version 78.0.1 browser, the console of browser gives following error:

"Content Security Policy: The page’s settings blocked the loading of a resource at eval (“script-src”)."


Payment process still works though. But, is there any way to avoid this error?

clover developer community
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered araja commented

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src

I don't see any use of eval in our script. Are you sure you don't have other scripts that are included in your page that use eval?

5 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

araja avatar image araja commented ·

It's very simple html page and when I add following line at shows the error:

const elements = clover.elements();

Inspecting in firefox shows that the error is coming from following file:

https://checkout.sandbox.dev.clover.com/scripts/index-7b61f880.js

at line# 1331 :

win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);

Let me know if you need more details.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ araja commented ·

Do you get the same error when using this code pen - https://codepen.io/gareth-dsouza/pen/MWKbWwv?

0 Likes 0 ·
araja avatar image araja David Marginian ♦♦ commented ·

Yes, 5 such errors. Probably one for each control.

FYI, I am using Firefox version 78.0.1 (64-bit).

0 Likes 0 ·
Show more comments
David Marginian avatar image
David Marginian Deactivated answered Rohit Bhardwaj commented

I have created an internal ticket for this and we will investigate it.

5 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rohit Bhardwaj avatar image Rohit Bhardwaj commented ·
Hi,


We are facing the same issue on FF 93.0. Since, DevPay APIs are deprecating on 27th Oct, 2021, we gave it a try and the code works fine on all other browsers except for FF.

Did you or your team come up with some solution to make payments work on FF browser?

Thanks.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ Rohit Bhardwaj commented ·

We tested with FF 93 and did notice an error in the console but everything still worked fine.

0 Likes 0 ·
Rohit Bhardwaj avatar image Rohit Bhardwaj David Marginian ♦♦ commented ·

The problem with me is that the payments are not going through in FF 93.0. If everything is working fine at your end, could you share a code sample that you tested with? It will be of great help.


Thanks.

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community