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

Are you seeing constand reloads of the app. I just installed to my actual phone pointing to an external server and I see:

Serving asset bundle version: 1f77520e4f43012e6497dedbf72f74474265d30b
2016-04-04 20:14:00.780 Buzzy[757:420356] ERROR Internal navigation rejected - <allow-navigation> not set for url='about:blank'
2016-04-04 20:14:12.561 Buzzy[757:421105] App startup timed out, reverting to last known good version
2016-04-04 20:14:12.576 Buzzy[757:420356] Serving asset bundle version: 1f77520e4f43012e6497dedbf72f74474265d30b
2016-04-04 20:14:17.543 Buzzy[757:420356] ERROR Internal navigation rejected - <allow-navigation> not set for url='about:blank'
2016-04-04 20:14:32.578 Buzzy[757:421203] App startup timed out, reverting to last known good version
2016-04-04 20:14:32.592 Buzzy[757:420356] Serving asset bundle version: 1f77520e4f43012e6497dedbf72f74474265d30b

I canā€™t actuallt get it to login inā€¦ I guess it keeps refreshing mid-login.

Alternatively, when I ran via Simulator, also pointing to the same server version, it seems to work.

Hi @adamginsburg, Iā€™m not actually, Meteor isnā€™t even bootstrapping (ie. no global ā€˜Meteorā€™ in Safari console).

Those reloads occur because the Meteor.startup() callbacks do not complete within the default 20 second timeout. It seems as if one of them might be failing.

Iā€™m not sure where those attempts to navigate to about:blank that you an @ryenbeatty experience come from. Do you have any additional packages installed?

This is my packages file:

# core
meteor-base
mongo
ecmascript
es5-shim
tracker
random
templating
check
 
# css
kit:cssnext-basscss

# mobile
mobile-experience 

# layout  
thereactivestack:blazetoreact
aldeed:template-extension
 
# accounts
accounts-base
accounts-password
useraccounts:core
useraccounts:unstyled 
gwendall:remote-ddp 
ongoworks:ddp-login

# utility 
skinnygeek1010:flux-helpers
zimme:active-route
momentjs:moment
gwendall:remote-autoupdate
lukemadera:social-share
matteodem:easy-search
mdg:reload-on-resume

As far as I can see, the only mobile specific ones would be reload-on-resume and mobile-experience

We have seen this with iFrame which donā€™t yet have a file loads. Looks like the default value of an iFrame is about:blank.

Not sure if this is related, but looking at gwendall:remote-autoupdate this will definitely not work with Meteor 1.3.

Ah nice one, thanks for pointing that out, should have checked! However no luck, removing that has same result.

I wonder if the blank issue I was having was around trying to redirect to an external site in the inapp browsers? ie My app is at https://buzzy.buzz and I have www.buzzy.buzz (externally hosted ā€œbrochureā€ site) when not logged in. So if you hit https://buzzy.buzz and was not logged in, I was doing the redirect with a window.location = http://www.buzzy.buzz. That site has hard codes links back to https://buzzy.buzz.

I am not sure if there is a better way to do this? Obviously, in a browser this works fineā€¦ it just seems to get hung up in Cordova (ie not sure if itā€™s ā€œlayeringā€ in app browsers when navigating to the external site and then back to the cordova app?

Iā€™m not sure I understand the whole scenario, but youā€™ll want to make sure to set App.accessRules for all sites youā€™re navigating to. Also, links back to https://buzzy.buzz would take you to your web app, and not the Cordova app (which is served from localhost:<port> on the device).

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