question

araja avatar image
araja asked ·

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?

Paymentsclover developer community
10 |2000 characters needed characters left characters exceeded

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 answered ·

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

Share
10 |2000 characters needed characters left characters exceeded

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 answered ·

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 Share
10 |2000 characters needed characters left characters exceeded

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

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 · ·

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 ♦♦ ·

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

Welcome to the
Clover Developer Community