I have a pretty standard geolocation implementation I'm using in JavaScript.
navigator.geolocation.getCurrentPosition(
function (position) {...},
function (error) {....}
);
It is and has been working great on Internet Explorer/Chrome on my main Windows machine, physical Android, IOS on different iPhones...It's not working on my Macbook Pro with HighSierra and latest Safari though.
I downloaded an old version of Safari for Windows, and while I know it's old and deprecated, I figured I could at least see and it doesn't work on that either so I feel like that somewhat means something as far as testing goes.
The error code I'm getting back is POSITION_UNAVAILABLE. Here's where it gets really weird, I got so fed up because it really is on my end inexplicable, I decided to try other websites on Safari that have demo geolocation to test, html5demos.com, w3schools etc. All return same thing on Safari when debugging their code. Same thing with the older version of Safari for all tests on all websites on a completely different machine.
My site is HTTPS, I have confirmed location services are enabled on Safari for the website, I'm prompted for approve/deny location. I've confirmed all location services are active on the MBP system preferences. I have no idea what the heck is the deal, I can't confirm if...it's something...on this machine since it's my only MBP I have access to, but again it works on mobile IOS and every other website I've tried that has a Geolocation demo on the MBP does not as well on my Windows box with the last available version of Windows Safari 5.1.7. I'm using wifi if that matters at all since I've seen a hard connection for whatever reason coming up sometimes as a problem when consulting Google.
Any ideas?
Related
I am trying to run mupdf built as web assembly in a webview on Android.
I have set the response headers correctly as far as I know, and this is illustrated by the fact that the web page using the web assembly works fine on desktop browsers and android browsers (including Chrome which uses a version of webview).
But when running a program of my own which uses a webview, the page when loaded gives a console message saying SharedArrayBuffer is not defined.
What I expect is that the webview in my program, when loading, should work the same as in the browsers. All other pages I use, with complex javascript, work the same way. But this one reaches the attempt to create a SharedArrayBuffer, and fails with an error in the console.
When I go to the page that tries to load the web assembly code, and which uses a Shared ArrayBuffer, I have checked and in every browser,
window.isSecureContext is true and
window.crossOriginIsolated is true
however, in the webview in my program
window.isSecureContext is true BUT window.crossOriginIsolated is false
I am having the exact same issue and there doesn't seem to be anything about this on the internet.
Webview (109.0.5414.117) doesn't seem to support cross-origin isolation, and my Xiaomi Redmi 7a Android 10 can't update to the newest version as of this writing (110.0.5481.64).
This is quite bad because there are a lot of phones that don't support newer versions of Webview and never will.
Here is the only discussion regarding this topic that I managed find: https://github.com/ionic-team/capacitor/issues/6182
On some platforms, Site Isolation is not available, due to implementation or resource constraints.
I have a simple app, created using PhoneGap [Build]. Signed up for a developer account and got the app actually signed & installed in a test iPhone I borrowed. The app works perfectly on Android, and testing it in a browser. However on an iPhone, it hangs at the 'intro' screen.
Apparently, to debug it I'd need a Mac, specifically Safari v6+ [dev tools], which isn't available for windows.
I just simply need a way to see the console / errors for what is going on. I have been searching and trying different methods for 3 days now, and have hit a dead end.
Figured I'd add what I ended up doing for anyone else searching for this down the road...
The easiest way to do this was to install MacOS on VMWare. This video was particularly helpful (https://www.youtube.com/watch?v=3b04Da1WjBc).
Then, under the USB controller in VMWare make sure to select USB 2.0 & 'Show all'. Then all you should have to do is enable Safari Developer Tools under preferences on your VM, plug in your phone, and you're good to go. Was 10 times easier than every other description I found on the web.
Edit: Also, do not allow the OS to update, that will kill it.
I am currently working on a HTML/JS application that will be embedded in an iOS and an Android app. Because the android app is not yet finished I am testing this on the chrome browser in Android. I fixed all issues there but when I open the same web app in the native browser nothing really works as expected.
So my question is : Is there a way to debug in a native browser on an android device?
In chrome this was pretty easy with remote debugging.
(Please do not advice me to use 'log' statements for debugging because that's not what I am looking for here)
And just to spill my guts : the Samsung Tablet's native browser is the only device that's causing me a headache!
Typing about:debug in the address bar of the native browser will toggle the 'Debug' options in the settings menu.
The 'Show JavaScript Console' option will allow you to see JavaScript errors in your webpage.
NB I believe the JavaScript Console will only be displayed if there is an error.
HTH
Nick.
The new Samsung Internet browser (I think you meant this browser with "Samsung Tablet's native browser") is now based on the Chromium browser and thus supports its remote debugging interface.
Enable USB debugging on your device as described here.
Then connect your device via USB (Oh, surprise!).
Visit chrome://inspect on your computers Google Chrome browser and you will be guided to create the connection:
Then you just have to click on the devices inspect link and an developer tools window will pop up.
More info like why there is an Samsung Internet Browser at all can be found here.
You can easily debug your web application with Web Inspector Remote (weinre).
Look at this post in order to find out how to install and use weinre.
I hope it will help you if this question is still actual.
If you have updated your device you can go to settings -> Debug -> 'Remote Debug Enable'
Once enabled you can debug the native browser just like you can debug chrome.
You can try vorlon solution too, it has a nice web interface & very easy to install
& It's free
But if you can't see clear console errors with volron, you probably want to use #Nick's solution, sometimes complex errors prevents even vorlon or weiner from catching them. So once you fix blocking these issues, probably volron will start catching them properly
I'm not even sure where to begin. Page loads fine on my 5, but not my 4S. Instead it crashes the browser to the home screen.
Without sharing the specific URL, can you point me in the right direction to debug this?
There are no discernible errors in Firebug or other debugging tools on my computer.
You should be seeing a crash report in Xcode organizer and an exception on the command line. Since this is an Apple app you should report this as a Radar.
Does your 5 have a newer version of safari?
Use the iOS simulator if you have it, and then try running with different versions of safari, you can get a log output from it, especially if you are using dashcode, otherwise I think it is in the system logger. That is, if you have a Mac.
I'm doing some rough development on the iPhone. I'm writing a native iPhone app, which uses an UIWebView object to load web sites with javascript. I find very difficult to debug the javascript code on an iPhone.
What are the methods/techniques available for this matter?
Since Safari on the iPhone is using webkit, you could use the debugger built into desktop Safari's web inspector. While there will probably be some quirks that are different between platforms, it will give you a pretty good idea of what's going on in the interpreter.
If you have access to an Android phone, you can debug your application using desktop Chrome's full developer tools and a USB cable (very convenient).
That means the debugger, profiler, HTML inspector, etc, all running on your mobile phone, but accessed through chrome running on your laptop/desktop computer.
Android Chrome and iPhone Mobile Safari are usually more similar to each other than Desktop Safari is to Mobile Safari, the screen format will be similar, the layout similar, and you'll be able to try real touch events, etc.
https://developers.google.com/chrome/mobile/docs/debugging
It'll require Chrome, an Android device able to run the android Chrome app, and a USB cable.
You have to install and use the ADB console command, but once its working, you'll have the full chrome developer tools interface available for debugging mobile.
Similar to Adrian Harris, it is possible to debug any website on the iphone by creating a dummy project in dashcode, clicking on "Mobile Safari" and then "Run"
Once the iPhone Simulator opens and safari opens with the dummy project website, click on the url bar of safari, enter any public url, and when you are at the site, you can click "Pause" and the debugger will pop up after any javascript code runs. At this point, variables can be inspected, breakpoints set, etc.
I know this is an old question, but wanted to update the answers with the latest info ->
The new safari (for mac) has a way to use the web inspector on an actual iphone or ipad in real time if you have the latest software (safari, iOS6, and MacOS) and an attached (with a cable) iDevice.
You access it by enabling it in the "advanced" safari preferences on the iphone, then under the develop menu in safari on the mac. See here for more info: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/DebuggingSafarioniPhoneContent/DebuggingSafarioniPhoneContent.html#//apple_ref/doc/uid/TP40006515
You can also access the simulators in the same way (installed with xCode).
I agree with pjbeardsley. I would add to use your web page within http://www.testiphone.com/ just so you can see what the dimensions will be like. I would definitely use Safari and the Web Inspector for it as well
I have had mixed success using Dashcode which has a javascript debugger paired with the iPhone Simulator. It is a bit tricky to get working because you can't launch it without opening a project. But as I recall, I posted the project on the web, launched a placeholder project, and then debugged the placeholder project in Dashcode. Then I navigated to my url in the Simulator and was able to set breakpoints. There were probably a few other hoops to jump through, but once it was working, it was like I had a real debugger within Mobile Safari, which was great.
Good luck