Cordova 3.7 duplicates iframes on every native cal

2019-03-25 15:40发布

Since I've upgraded to Cordova 3.7 every native call attaches a new iframe to the DOM like the one below.

<iframe src="gap://ready" style="display: none;"></iframe>

To exclude the possibility of my existing code influencing cordova I've tried creating a new one with cordova CLI, adding console plugin and calling console.log() in a setInterval loop inside deviceready handler. As a result I got a ton of iframes in DOM.

I've tried this on iPad 3, iOS7, building the app using xCode 6.

Did anyone experience this issue? Thanks.

UPDATE:

Corresponding issue was filed to Cordova: https://issues.apache.org/jira/browse/CB-8002 The issue should be fixed in 3.8 release.

2条回答
Evening l夕情丶
2楼-- · 2019-03-25 16:01

I also experienced the same issue. I am not sure why this is happens. But changing the

if (bridgeMode === undefined) {
bridgeMode = jsToNativeModes.IFRAME_NAV;
}

block into

if (bridgeMode === undefined) {
bridgeMode = jsToNativeModes.XHR_NO_PAYLOAD;
}

in the cordova.js function iOSExec() works for me

查看更多
Rolldiameter
3楼-- · 2019-03-25 16:03

The issue was resolved with the release of Cordova 3.8.0

查看更多
登录 后发表回答