Reputation: 81
When embedding a webpage via an iframe in phonegap, any links on that webpage will open the system browser instead of the iframe. This only occurs on iOS and only on the compiled version. Android and the phonegap app for iOS work as intended as webpage links open inside the iframe.
Config.xml preferences like 'stay-in-webview' and 'Cordova.plist' appear to be deprecated out and no longer work. Also 'ChildBrowser' preference is blackberry only. Finally the 'inAppBrowser' plugin has the same issue. It loads the webpage just fine internally but any links will trigger Safari to open.
The issue can be re-created by simply starting a new phonegap application, embedding an iframe, and then building for iOS / exporting with xcode.
Any help would be much appreciated!
Upvotes: 4
Views: 2135
Reputation: 81
Solution: At least in the latest phonegap (6.0 at the moment), having the below tags enabled for compiled iOS causes this issue. My best guess is that allowing these intents inadvertently tells iOS to open any / all embedded links in Safari.
I simply removed the below tags and everything is loading properly in the iframe
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
Upvotes: 4