history.back() doesn't work in Safari on iOS - javascript

My app is based on AngularJS 1.2.3. The application is enabled as a web app for iOS. The app contains back buttons with onclick handlers with the following code
history.length && history.back()
I've also tried using history.go(-1) as well. Problem is, the browser doesn't navigate back in history in Safari on iOS, or when the app is saved to the home screen as a web app. One thing i find weird however is that it works fine in Chrome on Safari, as Chrome actually is the Safari browser engine.
I know it have worked before, but doesn't anymore for some reason. The iPad is running iOS 7.0.4.

If you are using AppCache history.back will not work on iOS7 (check http://www.sencha.com/blog/the-html5-scorecard-the-good-the-bad-and-the-ugly-in-ios7/).
So if that's the problem, the easiest solution is to disable AppCache.

Related

IOS Geolocation in Javascript does refuse work after returning to webpage

I was trying to code a little html/css/javascript game for Android and IOS, using the GEOLOCATION WATCH feature.
I am using an https webpage.
In Android everything works fine. In IOS a had to add an Geolocation Request feature. It asks me inside the browser for Safari and the webpage if I would allow geolocations.
This works fine if I stay on the page, where I ask for the geolocations.
But if I leave that page to show another page (separate webpage) and THEN RETURN back to that webpage where I ask for geolocation, the geolocation watch function refuses updating. Only in IOS. Why?
What I tried:
IOS 12.2 and 14.4 => both the same
Adding clearwatch() function at
the top of the page before calling the geolocation function... does not work
Refreshing the webpage via the browser ... does not work
Closing Safari Browser totally, and reopening it... working
scanning the internet for solutions... did not find any
What has to be added to my webpage, so that the geolocation continues working when I return back from another webpage to my geolocation-webpage?
Regards,
Roger

classlist.toggle() does not work as expected on mobile safari

I have a function to add an open class to a drop down menu so it stays open on mobile browsers
the function worked fine also on safari, but now I saw it doesn't work on safari like before
the problem: it opens up the drop down menu but it doesn't close anymore only if you reload the site (or switch to another one)
tested I have nothing as I have no clue what even could go wrong with that code.
in chrome, firefox, edge also in chrome on android it's working fine
the function is the following (very simple)
function togglenav(tagid) {
document.getElementById(tagid).classList.toggle('navopen');
}
any idea what could go wrong only on safari?
edit: correctet the sentence that should tell on what browsers it's working (forgott the part that stated this)
Reload without content blockers?
Not sure if this is the same case as you're experiencing, but I had almost identical JavaScript that worked in mobile Safari on my wife’s iPhone X, but not on my iPhone 6. Turns out the model was irrelevant. I had the Better ad/tracking blocker running on my iPhone which stopped the script from loading.
If this is the case, tap/hold the URL and “reload without content blockers”. Worked for me, but worth bearing in mind that mobile Safari on my wife’s phone loaded it without a hitch.

Scrolling differences on Safari and Chrome (iOS) can you test for them?

It used to be (before iOS 8) that Safari couldn't natively animate on scroll, you had to stop scrolling to see the animations. Safari solved that issue, but when accessing the same website on Chrome (running in iOS) the issue persists. I read that chrome hasn't yet updated this on iOS. I know that it works great on Android... so... Is there a way to test for this "feature" either with modernizr or other js? I would like to disable animations on scroll if they are not supported. I've been able to accomplish this by checking which browser the user is using, but it would be easier if I could just check whether the functionality is available.
Before iOS 8, iOS would pause painting while the user was scrolling. This behavior was discontinued for applications using WKWebView but remains for browsers using UIWebView — this is why you only see the old behavior for certain third-party applications.
One approach is to detect whether your page is loaded inside WKWebView or not. An answer to another question suggests testing for indexedDB support. indexedDB is the only HTML5 feature difference between the WKWebView and UIWebView.
The snippet from the other answer suggests how to do this:
if (navigator.platform.substr(0,2) === 'iP'){
//iOS (iPhone, iPod or iPad)
if (window.indexedDB) {
//WKWebView
}
}

Angular application doesn't work on iPhone/Safari 5.1.7

Currently am developing a big project in AngularJS(version 1.3X), Bootstrap(3.3.1), animate.css and few other libraries.
I do test my application on different devices via Google Chrome Developers mode and on few browsers like Google Chrome, Mozilla Firefox and Safari(for Windows7).
I also have possibility to perform tests on Android device and iPhone.
For some strange reason my application seems to work on every device except for iPhone 5 with Safari 5.1.7(when using same Safari but on Windows7 it does work).
Has anyone before stumbled uppon similar problem?
#EDIT
Sorry, forgot to mention what is actually happening.
When I try to press button that's supposed to toggle (using jQuery, I know it should be done via ui-routing, but that's how my boss wants it) portion of the view (panel) it does not work. Buttons do not perform any actions. There is no reaction.

Meteor: google login doesn't work on iphone/ipad

I implemented a simple meteor site that uses google login. It works in desktop browsers. In Chrome, I use mobile device emulation and it also works. It also works on an android device I tried. However, it doesn't work on iphone/ipad. I use safari and chrome in iphone/ipad, but neither works. The issue is that when I click the link to login, nothing happens. But in desktop and android, it brings me to the google login page.
I have a test site: http://wwwtest.meteor.com/
It is deployed in debug mode so you can see the files.
Anything special that prevent iphone/ipad to work?
Thanks.
you need to add cursor: pointer; style to your a element (or catch touchstart/end events as described in the link). It is related to this issue: how-do-i-use-jquery-for-click-event-in-iphone-web-application.
After that, it should work. (Checked on ios simulator and it works)

Categories

Resources