Load external JS in app Cordova + Windows 8.1

1

I've now developed an html app with Angular where I need to make a transparent checkout on PagSeguro. For this, they ask for the inclusion of an external JS:

<script type="text/javascript" src="https://stc.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.directpayment.js"></script>

In the Web application, Cordova + Android and Cordova + Windows 10 I had no problems (changing the security meta tag, of course). But in the Cordova + Windows 8.1 app this script does not load! Reading about the subject I discovered that this is nothing new since Windows 8 has a policy of restricted access of HTML applications to external content such as CSS, Images and JS for security reasons.

I tried to download this JS from PagSeguro and manually insert it into the project, but there are several JS errors due to other requests that this file makes.

The question then is: how to circumvent it? How could I get this JS without all this headache?

    
asked by anonymous 22.02.2017 / 16:46

1 answer

0

Yes, there is a yes! As well as they did a "gambiarra" to put maps of Google Maps, it is possible to use the same technique. Just insert an iframe:

<iframe src="ms-appx-web:///pagseguro.html"></iframe>

This "pagseguro.html" page is a local file in the Cordova WWW folder and should contain the link to the script:

<script type="text/javascript" src="https://stc.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.directpayment.js"></script>
    
03.03.2017 / 14:05