jStorage not working in certain IOS safari browsers - javascript

I am trying to use jStorage on my site built on jQuery Mobile. It works fine on Chrome, Firefox, Android, some versions of Mobile Safari, and on IE 10 mobile on Windows Phone 8. It gives me an 'undefined' error when I try to set any value. For example, $.jStorage.set("FBID", response.authResponse.userID);
I have this issue on iPhone 5 (Safari 6.1) and iPhone 4S (Safari 6.0)
Enabling local storage on Safari does not help.
Any ideas or suggestions you could come up with?

Found the issue.... localStorage does not work on iOS when private browsing is switched on. When using jStorage, this causes error. Use the following if condition to ensure it does not show an error when browsing privately..
if($.jStorage.storageAvailable())
$.jStorage.get(key);

If you do a web search for "iOS 5 localstorage bug" you see that it's been broken in Mobile Safari for a while. jStorage utilizes HTML5 localstorage, thus why it does not work.

Related

Simulate a IOS environment for test website in safari

I'm developing an simples website using html, css/bootstrap and JS. I received feedback by Iphone user that some features not working in IOS mobile. Some Images not loading and counter-up not working too. In windows and android is working fine (chrome and Firefox). The question is, how I create a environment for simulate a IOS mobile for check how safari browser load my site? I tried install safari in windows but it not show equals execution in IOS. I think that browsershots not is a good ideia, because it works only with static content, and in the moment return 500 internal server error.
Microsoft BrowserStack provides a full test environment, however beyond the complimentary trial period it is not free. For errors related to pageload or reference, I would suggest you use device emulation and network throttling in a browser: Safari, Firefox, Chrome.
Some browsers are more forgiving of errors, so you may even have a typo. Is your trustworthy friend using an outdated browser while you require modern feature support? The scope of the problem seems undeserving of a bill for membership or tech support.

Webcodecamjs-QR code scanning Library not working in Safari browser

I want a mobile page to scan QR-codes and display it's content.
This is the page:
https://ndvibes.com/demo/TicketSystem/check (index.html)
Very weird, it's working on Firefox (Linux), but not in Safari (iOS 11.4 /iPhone 6).
I thought the library I used didn't supported Safari, or Safari restricted
it because of security reasons, but the demo of the library is working just fine on iPhone!
So it Safari seems to be supported, and it doesn't block it, because it's working in the demo...
I have no clue on how to fix this.
Safari asks for permission to access the camera, when granted, it just does not display the camera-content.
I also checked the settings of Safari, but didn't saw anything disabled that could block the webcam-video to show.
Edit: This code doesn't seem to work on Android either, very weird, the demo is working on desktop and mobile, and my own code is working on desktop, but doesn't work on mobile...
To Use on Apple devices you have to make sure:
1- You must use https, for the protocol http does not work.
2- You must use Safari because in Apple, the other browsers do not have permission or access to some javascript things.
3- must use some version so you can use both cameras.
Problem: I thought the library I used didn't supported Safari, or Safari restricted it because of security reasons, but the demo of the library is working just fine on iPhone!
Reason: I have gone through with your webcodecamjs.js and compared with demo webcodecamjs.js.I found that there are some differences in these files.May be lib-code taken from git and actual demo lib-code are diffrent.
Solution: Simply replace your webcodecamjs.js with demo webcodecamjs.js and it should work.
EDIT
Note: You have to start the camera by event trigger as Safari doesn't allow Autoplay.

voice recording from IPhone Chrome using HTML5 and javascript

I am working on a english learning website. One part of our service are voice recording and grading. We use getUserMedia API to get users voice, and it works fine on PC browsers and iOS safari, however, it couldn't work on iOS Chrome.
In caniuse compatible table, there is no iOS chrome item so I'm not sure is it possible to use this API on iOS chrome. Is there any other methods or APIs to get users voice on iOS chrome?
Unfortunately, you're probably out of luck. iOS keeps very strict limitations on what alternative browsers can do. This means that other iOS browsers like Chrome, Opera, etc. don't have access to many of the native features that Safari has.

Is the chrome.extension API available on mobile Chrome?

I'm writing a webpage that's supposed to encourage my users to install my Chrome extension if they haven't already. I have access to the chrome object when the JavaScript runs in Chrome, but not in other browsers like Safari or Internet Explorer. That's all well and good, but I was wondering whether the chrome object exists in mobile Chrome (Chrome for Android or iOS) and whether there is a separate API for those browsers. Thanks!
no, extensions or the .extension apis are currently not supported on mobile chrome.

Possible difference between "Safari on iPad" and "Safari on iPhone" on JavaScript

I have a project involving Google Maps API and some JavaScript codes. The page is build upon jQuery Mobile. I have the web page tested on Chrome, FireFox, Opera and IE on desktop, and on various mobile phones as well.
It doesn't work only on iPhone (4, nor 5). I mean, it's all good under Android, WP8, Chrome iPhone simulator, and even working perfectly on an iPad (Air, if matters).
It appears to be that Google Maps API is not loaded at all. It should be initialized after page load, and then show a map inside the page. But there's nothing. Also there's no alert about querying user's location, which does happen when using an iPad.
The safari on iPhone is the same version as that on my iPad, OS 7.0.4, Apple WebKit 537.51.1, Safari 9537.53. The devices are connected to the same WiFi network. Due to lack of a Mac I can't use the remote debugging function right now.
Any brief ideas about what's wrong with the application? I suspect it's inside JavaScript but I could be wrong.
Thanks.
I've found the problem and solved it.
It is because the location service is disabled for safari (by default), on iPhone. However it's enabled on my iPad (not sure if it's default) so that I get different reaction from the location service API.
I have to put an alert message for iOS users when detecting that location service is disabled. After it's enabled in the privacy settings on the device, the application works perfectly on all devices.
The patch code is here for those who need.

Categories