Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mobile Safari on iOS crashes on big pages

I have a problem where Mobile Safari crashes when loading and manipulating the DOM with jQuery when the pages get too big.

I get the same problem on both iPhone and iPad.

What are the best way to troubleshoot mobile pages to find the error? Are there any known problems that might crash Mobile Safari?

like image 722
Johan Nordberg Avatar asked Aug 06 '12 15:08

Johan Nordberg


People also ask

Why does Safari on iPhone keep crashing?

Safari accumulates caches, browsing history, cookies, and other data in the iPhone or iPad. Sometimes that data can interfere with app functionality, so clearing it out can be a remedy to problems with the app crashing or stalling on some web sites.

Why does Safari crash iOS 15?

After a long time of using Safari, a lot of junk files and temp files would contain in your iPhone. Data like caches, history, cookies and logs would influence the working experience of Safari and lead to Safari crash and stuck. Go to: Settings >> Safari, slide down and find "Clear History and Website Data".

Why do my webpages keep crashing?

There are a few different ways of how a website can crash, including code error, plugin problems, and expired domain, among others. A website is the window of the business. It's how a company communicates with clients. So every second the site is not operational, the business is experiencing missed opportunities.


2 Answers

I actually found the problem. It wasn't with JS as I thought, but with the CSS. I added class to make a CSS transition to fade in some elements. For anonymous users these elements had display: none; and probably never ran the opacity transition.

The strange thing is that the transitions was on exactly two elements. So why would this only crash on long threads with 100+ comments?

So the bottom line is: -webkit-transition crashed the page on mobile safari.

like image 53
Johan Nordberg Avatar answered Oct 14 '22 07:10

Johan Nordberg


Had the same issue, for me it was -webkit-transform: translateZ(0); that caused the crash of Safari.

like image 28
IndrekV Avatar answered Oct 14 '22 07:10

IndrekV