AngularJS app does not load on Safari back button (iOS 5.1.1). Any suggestions?

I'm having a problem with Safari on iOS 5.1.1 and Angular, where I am doing paginated results. After I decided to leave the page on which the application is located, and then return to the page using the back button to the browser history.

The application does not initialize, as I scroll again, the pagination function does not start.

Since 5.1.1 does not provide a web inspector, I had to rely on console.log to print events that I want to see it execute. When I boot, I see everything is in order, but when I go back, nothing works.

My usual fixes do not work. Here is what I tried:

  • Used manual download for Angular app
  • It is made so that the page does not support caching and the page expires as soon as it is displayed.

None of them helped, so here I ask for some suggestions. Unfortunately, it is not very easy to replicate through a Fiddle or hosted HTML file, so I cannot provide it. Hoping some of you may have experienced this before.

Thanks in advance for your help.

+4
source share
3 answers

The answer is quite late, and I hope you have found a solution already, but it may be useful for others.

Unfortunately, I canโ€™t answer why the application is not initialized (due to lack of code), but I can give you some tools / tips to facilitate debugging (provided that you have an iOS simulator).

Debugging on a mobile safari can be done either:

  • with weinre and get web combo features,
  • or by enabling remote debugging in Mobile Safari, see here
0
source

Yes, the same problem here with iOS 7. It should send a DOM structure before running any javascript. Kinda is pointless ...

0
source

Since the issue is related to mobile safari, and since it supports the popstate event, you can use this event to detect when the user returns in conjunction with $ location.path (), for example:

$(window).bind("popstate", function () { alert(location.pathname + $location.path()); }); 
0
source

Source: https://habr.com/ru/post/1490603/


All Articles