iOS Safari Won't Refresh Javascript Content - javascript

I just created this Awesome Website with some interactions, but I found a bug on iOS Safari about the 'Firebase' Animation (it won't work). So I connected my iPhone(iPhone 6, iOS 12) to my Mac with a cable to use the Safari Web Inspector.
But then even when I reload the page or open it again, the JavaScript content won't reload. However, on desktop browsers, the changes have been applied.
The bad thing is that I'm a student and there's this stupid thing about screen time that blocks private mode and history&cache delete.
I really need to fix this bug and there's a bunch of other bugs to fix, so probably waiting until the page fully reloads will drive me nuts. Is there any way to do a 'hard' reload, or is there any other ways to fetch data from the server again?

Just found the answer.
Connect the iPhone to your Mac via USB cable, open the web inspector, then press ⌥⌘R.
The keyboard shortcut also works for iOS safari.

Related

JavaScript on iPad needs regular reboot of network connectivity

One website I regularly access on my iPad has various JavaScript elements which stop working after around 15 minutes of use (it appears not to be after a set number of actions, if I do one interaction then leave it 15 minutes I have the same problem).
The problem happens on two different iPads on the same network. A fairly old iPad 3 with latest iOS 9.3.5 and a brand new iPad Mini 2 also with latest iOS. If I use mobile internet connection (tethered to my phone) rather than my in-house Wifi I don't have the problem.
The problem doesn't occur on desktop browsers, even when running as an iPad by updating the agent.
The website owners are supposedly investigating, but have said they can't recreate on their mobile test devices. Don't know how hard they have tried mind you!
Originally I though that the only thing that can make the website work again was to switch off and power on again the iPad. Closing the tabs, or the whole browser, or clearing history etc, makes no difference, only powering off and on again. I have more recently figured out that just disconnecting from the network and reconnecting, then reloading the page appears to reload the failing Javascript elements.
Using private browsing until the problem occurs and then closing down the tab, leaving private browsing, and then re-entering has certainly cleared all information as I have to login to the website again, but the problem persists.
So my question is, what could a network do to stop loading javascript parts of a webpage that disconnecting and reconnecting would fix? i.e. what might I have to fix on my home network? If there is any other information I can give, please do let me know.

Android Chrome Website

Guys I build a website and when i am accessing it from the android browser(Default) A script that is very important on the functionality of my website is not being displayed. But when I am accessing it from the android google chrome browser the script is being displayed as I was expected to see.
My site is responsive, it adapted to the screen of the user.
I am using galaxy note 2 and the android version is 4.3.
I was thinking to build an android application such as a browser that is going to be always fullscreen and locked on my site but i do not what google chrome browser has and making my website as I want it to be.
Any help?
I'm not sure what you mean by Android Browser (default). Is there a Samsung Browser already preinstalled on the phone that isn't Chrome?
My guess, off the top of my head, is that JavaScript is disabled on this other browser. If you were to create your own browser with an Android WebView, JavaScript is disabled by default and must be manually set to true.
A quick Google search for 'Samsung Note JavaScript' doesn't return anything readily apparent, but here are a few different Samsung Models with directions on how to enable JavaScript on their browsers. I would imagine the process is similar for the Note 2.
http://support.t-mobile.com/docs/DOC-6782
http://www.droidista.com/2014/06/enabledisable-javascript-on-samsung.html
http://www.att.com/esupport/article.jsp?sid=KB117209&cv=820#fbid=omMGs_GnNUf

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.

Google+ JavaScript API Login Popup not returning Chrome on iOS

I am using the Google+ Javascript API log in button and it works perfectly fine in Chrome on Windows and Android. It also works perfectly fine in Safari on an iPad and iPhone. However, when using Chrome on the iPad or iPhone, the pop-up tab for the Google log in never returns after clicking to allow access. It seems to be submitting the form to the pop-up tab and never directing back to the original tab. Any ideas?
Google knows about this issue, but currently cannot do anything about it. It comes down to window.open not working in UIWebview.
Safari is not limited by App Store rules the way all third-party apps
are. Apple can use any WebKit APIs they want to, whereas we are
constrained to what is possible using UIWebView.
They encourage anyone facing this issue to open a bug with Apple.
You can't make Apple do anything, but anyone affected by this can
file a bug against Apple about the fact that UIWebView doesn't support
window.open and subsequent cross-site scripting, to clearly
communicate demand for that support.
There's no way for people to add votes or comments to existing Apple
bug reports, so the usual advice is for everyone to file their own.
Here's the URL for bug reporting in Apple: https://bugreport.apple.com
Here is a sample bug posting to Apple provided by one of the users:
Summary: Please add support for window.open and subsequent cross-site
scripting to UIWebView. This is blocking Facebook/Twitter/etc login
workflows in Chrome for iOS for example
Steps to Reproduce:
1. In a tab, open a page that runs the code var w = window.open(yourURL, null, null);
2. The page at yourURL should try to accesswindow.opener`, such as to postMessage back to the original page
3. Don't profit.
Expected Results: New window can access window.opener.
Actual Results: window.opener is undefined.
Version:
7.0.4
Notes:
Configuration: Chrome Version (from "Settings > About Google Chrome"):
19.0.1084.60 Device Type: iPad 3
You can follow the issue thread for updates.

iOS 5 Mobile Safari application cache changes?

I'm wondering if anyone has run into new problems with using the HTML5 application cache in Mobile Safari on iOS 5 devices? I had previously written an offline web app that worked well in iOS 4, but as devices that use this app are being moved over to iOS 5, I am discovering problems when devices are offline and attempting to access what should be cached resources.
I can confirm that the application caching procedure is working as expected, as I can track the hits to my webserver as resources are downloaded while the device is online.
The problem manifests itself in the form of the "Cannot Open Page: Safari cannot open the page because it is not connected to the Internet" dialog box when I attempt to follow a link to a page that should be cached while I am offline.
Interestingly, around the same time this error pops up, in the Debug Console one also gets the "JavaScript execution exceeded timeout" error, similar to what is mentioned in this thread. I'm not doing any computation nearly as complicated as what was posted there, but the suggestion to kill and restart Safari seems to fix both problems, at least for now.
So maybe this question is less a request for help and more of a landing place for future searchers to share their experiences.
Please check if you have added the cached page itself into the manifest file, in below example they are HTMLPage1.htm & HTMLPage2.htm. I have the same problem but it works after adding the cached page link.
CACHE MANIFEST
CACHE:
images/cover.png
HTMLPage1.htm
HTMLPage2.htm
NETWORK:
*

Categories