cancel
Showing results for 
Search instead for 
Did you mean: 

Cybersource iFrame in Cordova iOS App

Hello,

I'm trying to implement the Cybersource iFrame in our Cordova iOS application, however the WKwebview that hosts the application does not allow the http or https scheme, and I cannot use another scheme to access the iFrame with localhost.  Is there an alternative way of allowing Cybersource to work with our application given these limitations?

5 REPLIES 5

You can install cordova-plugin-ios-xhr and set

 

<preference name="allowFileAccessFromFileURLs" value="true" />
<preference name="allowUniversalAccessFromFileURLs" value="true" />

for files to work with file://

FlanZarianick
Member

When trying to open an iframe, the code tries to get the original window.open clobber using modulemapper.getOriginalSymbol(window, 'open');
But the clobber you registered in plugin.xml is 'window.open'
This causes an infinite loop resulting in stack overflow. 

A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md /omeglz Then we maintainers don't have to try to code it, but can rely on something that you say recreates the problem.

MurbiesWalto
Member

https://github.com/regevbr/cordova-plugin-inappbrowser-bug /echatandom reproduces the bug.
When you start it on android you can see

inappbrowser.js:1 Uncaught RangeError: Maximum call stack size exceeded
    at module.exports (inappbrowser.js:1)
    at module.exports (inappbrowser.js:96)
    at module.exports (inappbrowser.js:96)
    at module.exports (inappbrowser.js:96)
    at module.exports (inappbrowser.js:96)
    at module.exports (inappbrowser.js:96)
    at module.exports (inappbrowser.js:96)
    at module.exports (inappbrowser.js:96)
    at module.exports (inappbrowser.js:96)
    at module.exports (inappbrowser.js:96)



When you inspect it.

Basically we have a named iframe which is empty at the beginning

 

<iframe src="" name="test_iframe"></iframe>

Then we perfrom open on it when the device is ready

    onDeviceReady: function() {
        this.receivedEvent('deviceready');
        window.open('https://api6.ipify.org/','test_iframe');
    },

 Could you check if the delete window.open thing described here https://github.com/apache/cordova-plugin-inappbrowser#windowopen /echatspin if it fixes it? 

SharphSonirak
Member

Hello,

If the content is served in an iframe from a whitelisted domain, that domain will have access to the native Cordova bridge.

joseemily
Contributor

You can install cordova-plugin-ios-xhr and set

<preference name="allowFileAccessFromFileURLs" value="true" />

<preference name="allowUniversalAccessFromFileURLs" value="true" />

for files to work with file://

kellyoua
New Member