Script not loading on iPhone - javascript

Recently I made my portfolio website and as I tested it today, everything works just fine on all of the most popular browsers. The problem is - I have access only to phones with Android and laptops with Windows. That way I am unable to test Apple devices and Safari itself.
For that, I asked my friend to visit my website on her phone (she has iPhone), so I can check if everything is ok. Unfortunately, when she entered my domain, Safari was unable to load JavaScript at all. What's even worse, she then installed Google Chrome and Mozilla Firefox, and the same stuff happened.
We were testing my website also on MacBook - that time also on Safari and Chrome. On Safari, there were some errors (it seems that at least part of the script worked), and on Chrome everything was right. I wasn't able to explore the problems, as we only had limited time via phone call.
Right now, my main issue is - why any browser on iPhone was unable to load the script? I would be very grateful if someone with iPhone or other Apple device could tell me what's happening there. The additional issue would be the Safari on MacBook. Because in this case, I was unable to detect anything useful, other than that only part of the script seems to be working.
Also, I don't know if that matters, but I used Webpack to bundle all JavaScript files. All code + domain can be found in the links below:
The website domain is: www.pmiecznik.pl
If you want to see those scripts/ style files - they are in the src folder in my GitHub repository.

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.

Angular (7.2.10) app failing to load on Chrome on iOS 12.4.1

I'm currently working on an Angular application (7.2.10) and on the latest version of iOS available on my device (12.4.1) we have hit an issue that I can't seem to figure out. The issue only occurs on Chrome on iOS, I am unable to replicate this issue on any other browser on the affected devices. The iPad air (1st gen) I am running against is using Chrome version 77.0.3865.93. It was first reported by a colleague using an iPad Pro, and we have has a couple of clients call in saying it's not working on their iPhones.
If we load the entry point to our web application (https://ams.invenias.com) the screen is completely blank. Nothing loads, and the spinner stops immediately.
I've tried a few avenues to try and get to the root of the problem, but I am yet to get anywhere. I have...
Using ios-webview-app to run iOS simulator within safari on a mac. This just resulted in the website loading as normal, so something wasn't being simulated correctly.
ios-webkit-debug-proxy to attempt to get developer tools in chrome for iOS. This ended up not working at all, either I was unable to get it running or our particular network setup meant it would never work.
Using weinre to get some sort of developer tools to read network activity/logs. I wasn't able to get this running initially, however after a bit of tinkering I was able to use this alongside Browserstack to get developer tools. Unfortunately, nothing in the logs or DOM was erroring or showed any reason as to why it might not be starting correctly.
After connecting via number 3, I was able to find out that angular itself is not bootstrapping, and no javascript is being executed on the page (from within the transpiled code, javascript included in other .js files, or within index.html executes correctly.) I'm now on day 3 with this issue, and no end in sight.
Oddly enough, if we use the 'Request Desktop Site' feature within the browser, the site loads perfectly.
Thanks,
Cameron

Debug an External Javascript against Documents inside Mobile Safari

This question is related to my earlier question How to Debug Javascript in IOS Action App Extension. Basically, I am developing an mobile safari extension, and part of the work is to develop a javascript (operating on top of "document" provided by mobile safari) to run inside the app extension.
However, I have not found a way to debug a javascript file inside an app extension. Now, I am trying to ask the question a bit differently - given mobile safari on a page, can I somehow run an external javascript on that page and debug this external javascript? I suppose that Safari Web Inspector could help with that? Thanks.
(This is a slightly customized answer from your other question)
The official documentation for this is [here][1].
It's not too hard, although recently I've had an issue with the page showing up when connected to the iOS simulator. In that case I just ended up using my phone directly. (Apparently you need to start desktop Safari after the iOS Simulator has started to inspect "remote" Simulator sessions)
Ensure that on the device Settings->Safari->Advanced->Web Inspector is on.
(Make sure you've Trusted the computer from the device)
Start MobileSafari on your device.
Start Safari on your desktop, make sure Show Develop menu in menu bar is on in Preferences.
In the Develop menu you will see your device name, say 'BSharer's iPhone'.
select the page name underneath your device name, say 'en.m.wikipedia.org - Wikipedia'.
You are now debugging that device's page on your desktop. The developer page will open and you can debug as if it was running on the desktop machine. You should now see all the JavaScript that is available to that page and set breakpoints.
(The app extension requires the debugger; statement because we don't see the javascript files injected by the app extension. You can still use the debugger statement but it's not usually necessary.)

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.

Firebug like debugging on Android

I have seen several posts that talk about remote debugging of javascript code on Android, but they all miss the point of what I am trying to do.
I have a Nexus 7 and I want to use it as a remote development environment when I am away from my desktop. I have created a chrooted debian distribution to run apache and php and git (via ssh). This chrooted environment mounts a subdirectory of the /sdcard directory from outside the chroot environement. Apache document root of a virtual host is pointing at a directory within this. Before leaving the desktop I can git push the latest release to the tablet. When I return git pull can get what I have done back again.
I then (when away from home and NOT connected to any network) can edit the code using an Android editor (using the 920 text editor), but then run the browser to look at what I have developed using localhost the apache virtual host picks this up and displays it.
The application I am developing IS NOT FOR ANDROID - it is ultimately for the desktop. But I want to be able to debug it like I was on the desktop. Breakpoints and single stepping are the prime thing, but also I tend to use the html section in firebug to adjust my CSS before editing it.
Is there a way to get either the chrome developer tools or firebug add on for firefox to load into a browser that will run in android?
I use Firebug lite bookmarklet for iPhone and iPad, never tried on Android, check this out http://martinkool.com/post/13629963755/firebug-on-ipad-and-iphone it must be similar on Android.
To activate it use this steps:
Create a new bookmark or bookmark a page
Rename the bookmark to “Firebug”
Copy the textarea link:
javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?Fi+'NS':Fi;Er;Er;Er;(Fe[0]||Fe[0]).appendChild(E);E=new%20Image;Er;})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');
Edit the Firebug bookmarklet, remove the URL and paste the
bookmarklet
Choose “Done” (on the virtual keyboard) and you’re all set
Hitting that bookmarklet should give you a fully functioning Firebug at the bottom of your mobile device.
At least not for Firefox Mobile, because all the devtools are still partially based on XUL, where the Firefox Mobile is using Native UI.
I don't think there is any plan in the close future to change this situation; it's not a common scenario.
However, you should be able to do something using the Debugger API, creating an add-on for Firefox Mobile. But I don't know if it's worthy.

Categories