1.3-beta.11 / iOS / iFrame / <allow-navigation> / App.accessRule

Thanks @martijnwalraven I have the core scenario working now.
I still have 2 issues I need help with please:

  1. I am getting @ryenbeatty issue
ERROR Internal navigation rejected - <allow-navigation> not set for url='about:blank'
  1. I can’t see google docs in an iFrame on Cordova (works fine on desktop). I have the following in my mobile-config.js below
    App.accessRule('*.google.com/*', { type: 'navigation' } ); 
   App.accessRule('*.googleapis.com/*', { type: 'navigation' } );
  App.accessRule('*.gstatic.com/*', { type: 'navigation' } );

I am also using Browser Policy

  BrowserPolicy.content.allowOriginForAll('*.google.com');
  BrowserPolicy.content.allowOriginForAll('*.googleapis.com');

Any ideas pls?

  1. You have an iframe? Add a url (can be to an empty page) to load. Add that url preferably in the html code. If there is no url a browser will load about:blank, if there is an url it won’t happen.

  2. No error?

@lucfranken thanks

re #1 - I am not sure where this is happening - perhaps it’s the Google doc iFrame? Ie #2 below. When I check the source it seems like there are multiple iFrames for things various 3rd party things like Stripe.

yep #2 - no errors I can see in XCode or the console. I can include iFrames for other sites like youtube, vimeo etc… all works OK on Cordova
An iFrame to googleDocs works fine on the site (so BrowserPolicy seems OK) but when on Cordova it’s just blank and I cannot see an error.

In the past I had cors issues and I’d see it on the console, although that was Meteor 1.2 not 1.31

So could #1 cause #2?

It seems the iframe is indeed not loading correctly and trying to load about:blank instead.

BrowserPolicy is not used on Cordova, but it includes a permissive set of CSP settings.

Could you try remote debugging with Safari to see if you get more detailed errors?

HI, where’s the console from XCode:

2016-04-28 19:12:46.051 Buzzy[1459:431395] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/<long string>/Library/Cookies/Cookies.binarycookies
2016-04-28 19:12:46.136 Buzzy[1459:431395] Apache Cordova native platform version 4.1.0 is starting.
2016-04-28 19:12:46.136 Buzzy[1459:431395] Multi-tasking -> Device: YES, App: YES
2016-04-28 19:12:46.144 Buzzy[1459:431395] 

Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file

2016-04-28 19:12:46.197 Buzzy[1459:431395] Using WKWebView
2016-04-28 19:12:46.198 Buzzy[1459:431395] [CDVTimer][handleopenurl] 0.057995ms
2016-04-28 19:12:46.201 Buzzy[1459:431395] [CDVTimer][intentandnavigationfilter] 3.178000ms
2016-04-28 19:12:46.201 Buzzy[1459:431395] [CDVTimer][gesturehandler] 0.063002ms
2016-04-28 19:12:46.301 Buzzy[1459:431395] Serving asset bundle version: d57009ee64c8f614689f89e96087a140487fb304
[INFO] GCDWebServer started on port 12456 and reachable at http://localhost:12456/
2016-04-28 19:12:46.303 Buzzy[1459:431395] [CDVTimer][webapplocalserver] 102.077007ms
2016-04-28 19:12:46.308 Buzzy[1459:431395] [CDVTimer][statusbar] 4.920006ms
2016-04-28 19:12:46.319 Buzzy[1459:431395] [CDVTimer][splashscreen] 10.930002ms
2016-04-28 19:12:46.321 Buzzy[1459:431395] [CDVTimer][file] 1.401007ms
2016-04-28 19:12:46.321 Buzzy[1459:431395] [CDVTimer][TotalPluginStartup] 123.304009ms
2016-04-28 19:12:46.595 Buzzy[1459:431395] active
2016-04-28 19:12:50.046 Buzzy[1459:431395] THREAD WARNING: ['Device'] took '22.695068' ms. Plugin should use a background thread.
2016-04-28 19:12:50.203 Buzzy[1459:431395] ERROR Internal navigation rejected - <allow-navigation> not set for url='about:blank'
2016-04-28 19:12:50.232 Buzzy[1459:431395] Domain: localhost
2016-04-28 19:12:50.232 Buzzy[1459:431395] FROALAKEY: 
2016-04-28 19:12:50.425 Buzzy[1459:431395] Push Plugin register called
2016-04-28 19:12:50.836 Buzzy[1459:431395] ERROR Internal navigation rejected - <allow-navigation> not set for url='about:blank'
2016-04-28 19:12:50.837 Buzzy[1459:431395] ERROR Internal navigation rejected - <allow-navigation> not set for url='about:blank'
2016-04-28 19:12:51.032 Buzzy[1459:431395] network
2016-04-28 19:12:51.867 Buzzy[1459:431395] Push Plugin register success: <3long string>
2016-04-28 19:12:52.190 Buzzy[1459:431395] active
2016-04-28 19:12:52.239 Buzzy[1459:431395] Push Plugin register success:

Could you try remote debugging with Safari? That may give you more detailed information about which network requests are failing.

@martijnwalraven I understand that the Safari console will only open after the app is already open so too late to get that initial debugging, unless you know of a way to open it prior to clicking the app? (I did try the “Automatically show Inspector for JS contexts” ) the inspector flashes up closes a few times… but eventually closes with nothing on it.

You can use window.location.reload() from the Safari console to reload the app.

Thanks

I am using the package The trusted source for JavaScript packages, Meteor.js resources and tools | Atmosphere should I be using something else?

This is a known issue with mizzao:timesync and Meteor 1.3, and a pull request has been submitted but doesn’t seem to be merged yet.

I don’t think this explains your original issue however, because XHRs do not result in navigation to about:blank.

Ah, one thing I did overnight was I upgraded to Meteor 1.3.2.4 and it seems like the “about:blank” issues have gone. Could this have fixed it my #1 issue?

This also seems to have resolved the #2 issue and the Google Docs iFrames are now working too. Thanks heaps for the help. Yay!

BTW, the reason I had not upgraded from Meteor 1.3.1 previously, is I had a blocking issue around Bootstrap that seemed to stop working on 1.3.2.4… I moved from the https://atmospherejs.com/nemo64/bootstrap package to https://atmospherejs.com/huttonr/bootstrap3

Hmmm, I don’t think there are any changes to the Cordova integration between 1.3.1 and 1.3.2.4. But I’m glad it worked out for you!

Thanks.

Is there a way to force a refresh from the sever side as the app (based on Meteor 1.3.1) won’t seem to refresh since I upgraded the server to 1.3.2.4. ?

I have resubmitted to the app store but that can take time and not everyone updates.

If there are indeed changes in the set of Cordova plugins, there is no way to force a refresh through hot code push.

Ugh. Ok I did add new plugins, but I thought the Meteor code would refresh as usual… I guess it’s dependent on the plugins being there.

Yeah, hot code push can only be used to update JavaScript code, and to avoid incompatibilities we block updates if native code has (potentially) changed (see here).

Has anyone gotten a handle on this? I’m able to see my iframes when I test on mobile locally, but if I use meteor run android-device --mobile-server, I’m not able to see the iframes. They show up on mobile in a browser, but not on the app.

Which errors do you see?

I’m not seeing any errors. There’s space where the Iframes should be, but they don’t show. It’s weird to me that they show on the production site on mobile and desktop, but not in the app. I’m using The App.accessrule. I’m not sure what’s happening there.

Are you doing this debugging? 1.3-beta.11 / iOS / iFrame / <allow-navigation> / App.accessRule please add some screenshots.

1 Like