2
votes

When I open a angularjs app in iframe on a page everything works fine on all browsers. But then in firefox if I refresh using ctrl+f5 I get this very nasty error starting with nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame" ...

Please see image: (not sure if you can acutally read it) error

You can test it your self, open link https://www.ipushpull.com/embed/SCAR/Alpine in firefox, you should see login form, press ctrl+f5 and you should see the error.

Other browsers are fine.

I seen few other discussions, some mention this could be because of CORS requests (I am using) which I dont see probable because other requests are working fine in firefox on the same page (when you open taht page it makes request to the api that returns what it should)

Other mention it has something to do with window history, which might be because once you arrive to that link and API returns 403, it redirects you to angular uri #/user/login , but I didnt find any solution I could try out with the history.

Any ideas? thanks a lot

Update

I see you cannot open up the image, here is "full-res": http://i.stack.imgur.com/7SYQ8.jpg

Update 2

  1. This is not due to CORS issue. I am using CORS throughout the site without an issue, even there are other CORS requests on that very same page and they work.

  2. It is not caused by any adblock/popupblock addin, I tried in completely wiped out browser.

  3. Using non-minified angular for debugging - Actually I didn't think this would matter for debugging (as I have confidence in angular), but quess what. If I change to un-minified angular the error does not happen.. Any ideas?

2
I really dislike websites that dont let you hit the back button. Here is the correct link for a "fuller" rez file: i.stack.imgur.com/7SYQ8.jpg - Ronnie
@Ronnie Actually this is basically embedding widget that you put into your site. So the navigation is done purely by the app. I just gave the direct link so you can see it fullscreen. - Tomas
ah, gotcha. yeah the dropbox link was small. When you upload an image via SO, it gets uploaded to imgur and if you right click it and 'view image' or 'open image in new tab' it will show you the larger image. - Ronnie
You should probably start by not using the .min version of Angular if trying to debug or make others debug - lajarre

2 Answers

1
votes

I have run into a similar issue trying to open an Ember app using history.pushState (Ember Router location: 'history' method of routing) inside an iframe. It appears the issue only occurs when doing a hard refresh (cmd + shift + r on Mac or ctrl + f5 on Windows) in Firefox. The issue only occurs for me in FireFox, works fine in Chrome and Safari with similar hard refresh. I also verified that the issue occurs for me as well opening an Angular JS app using $locationProvider html5mode(which also uses history.pushState under the hood) in an iframe in FireFox.

The issue does not occur for me when navigating to the page for the first time or when normally refreshing the page (cmd + r Mac, f5 Windows). I have found many seemingly related on Bugzilla for Mozilla but many are close. This one seems to represent the same issue I am having and is still open as of current versions of Firefox (v37.0.1 at time of writing).

https://bugzilla.mozilla.org/show_bug.cgi?id=1003100

Opening either an Ember or Angular app(or whatever technology...) in an iframe which uses hash based routing appears to be a viable work around for now. I could not reproduce the issue using hash based routing methods for either framework.

0
votes

Minification in AngularJS causes problem if you don't declare the service dependencies list (in an array) followed by the function itself. However, I looked through your code and looks like you got it covered. I could be missing something here, so it's a good idea to go over one more time just in case.

On another hand, it could be false negative. I also got some errors in Chrome when I refresh the page before all the dependency js files are fully loaded. Since you have Firebug Persist mode, some requests are not canceled and causes an overflow exception like the 3rd one in your attached image.

So for this error, if you turn off the watches, they should go away.