When was S.browser_fallback_url introduced in Chrome? - javascript

I'm writing a web application (JavaScript, angularJS, etc) that runs better on Chrome, so it tries to launch it when, it's running on Android and it's opened on the default Android Browser.
If Chrome isn't installed, I want it to go back to the Android Browser (instead of the Google Play store).
So I'm using an intent of this form:
intent://localhost:3011/#Intent;scheme=http;package=com.android.chrome;S.browser_fallback_url=http://localhost:3011/?intent=no;end
My problem is that when I run this on my android tablet (no-name, Lollipop 5.1.1, Default browser: Chrome 39) it doesn't work. When I use the separately installed Chrome (trying to load, e.g. firefox which isn't installed) it works.
So in order to proceed I need to know if I'm doing something wrong, or if there's some other reason.
My question really boils down to this: should the browser_fallback_url work in the old default browser, or is it a newer feature in Chrome (so it's useless to my use-case).
Thanks.

I worked on this and wrote about it and updated the official documentation it was introduced in Chrome 40.

Related

Inspecting javascript variables as code popups in chrome

Anyone know how you get the yellow popup to appear when inspecting javascript variables in chrome? Apparently you just hover over the variable when the debugger is paused to see a variables current state but for whatever reason I can't get this to work.
If you have no idea what I'm talking about checkout this screenshot:
This happened to me before. Just close all Chrome instances or restart it. This should fix the problem.
I have no idea why this wasn't working but I tired a clean install of chrome on a different user profile on my mac and worked fine. So I went back and dumped all the preferences and application support files and turned off all extension on my profile and it worked!!! So moral of the story do a clean install of Chrome.
The same thing happened to me on 16/12/19, with version 79. But in Chrome canary, it is working fine. People who need can download it here (you can use it for now) or you can use Chrome Dev here
For the people who don't know about Chrome Canary or Dev
Chrome Canary is an experimental version of the popular Chrome browser. Google offers four release channels for its Chrome browser: Stable, Beta, Dev, and Canary. Most people use the Stable release of Chrome, which is rigorously tested and considered very reliable.
By contrast, Chrome Canary may appeal to people who like noodling around with new technology and want to get an advance look at what the standard Chrome browser may look like in the future.

Is there a way to debug JavaScript in the iPhone/iOS Safari browser?

I have a strange behavior on the iPhone browser. Is there a tool to debug the JavaScript of the iPhone browser?
I'm hoping there's something more advanced than simple alert() messages. Is there something with advanced tools like setting breakpoints and viewing object states?
With the release of iOS 6, Apple released Remote Web Inspector for their Mobile Safari, and this is huge. Basically you have all the features and power of Web Inspector in regular Safari, for your mobile apps, including Phonegap apps.
I've used weinre but this tool makes it obsolete for newer versions of iOS (unfortunately not for old versions of iOS, non-iOS devices, or if you're on Windows) since its a full-featured debugger with breakpoints and everything.
Requirements:
A Mac with Safari 6+
Either a USB-attached iOS 6+ device or xCode 4.5+ running an iOS 6+ simulator
How to activate the inspector:
In your simulator or device, open Settings > Safari > Advanced > Web Inspector > On
(this is on by default in the simulator)
In Safari 6+ for Mac, access your page from the Develop menu. You can enable Develop menu in Safari's Advanced Preferences if its not showing up.
More discussion at the bottom of:
http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
(Also, if you read about a "secret private interface" or iWebInspector somewhere, these are also made obsolete.)
check out weinre or use the remote version debug phonegap.
cu
you can also inject firebug using a simple bookmark. I've used it on the ipad and my debugging abilities were immensely enhanced.
I faced a simple use case in which I only needed to test my code on a Safari's JS engine (Merely debugging, simply running it and consuming traces).
To that end I used Epiphany web browser, which is both free and uses JavaScriptCore JS engine which is also used by Safari.
Epiphany isn't provided with developer tools, so I used http://jsconsole.com/ to view my traces.
Though it is a thin solution, it helped me find a line which worked on Chrome but didn't on Safari.
Step by Step Guide How To Enable JavaScript in iPhone
Open your iPhone settings.
Tap on safari in the app list.
Tap on Advanced option.
Enable Javascript iPhone with the help of switch push.

How do I debug Internet Explorer on Windows Phone 7?

I'm not a Windows Phone developer, and I want as little to do as possible with anything related to Microsoft. Nonetheless, I need to get my mobile web app running properly on Windows Phone 7. What debugging tools are available for the platform? Something like the Webkit developer tools or Firebug would be ideal, either from the phone itself or more likely, remotely debugging from my computer.
If such a thing doesn't exist, I'd settle for being able to read Javascript error messages, and view the contents of variables using alert() or similar. At this point, all I know is that my JS is failing: I don't know where or why, let alone how to fix it.
My dev computer is running OS X, and I'd really like to be able to use these tools from OS X if possible. Assuming that debugging tools exist (which I really hope they do) are they designed for Windows only? If so, does anyone know how well they would work with Wine or similar?
EDIT: I have a physical Windows Phone 7 device, so I can use that. However, alert() doesn't seem to be working, which is why I'm posting this question. Does alert() normally work on the WP7 browser?
You'll likely find the Mobile Perf Bookmarklet to be the easiest all-in-one tool for testing any mobile device.
Works well on the iPhone/iPad/Samsung Galaxy Tab in my testing so far.
Quote:
It displays a menu with links that load other bookmarklets including Firebug Lite, Page Resources, DOM Monster, SpriteMe, CSSess, and Zoompf.
Unless you have a Windows Phone 7 device, you will need to run Windows in BootCamp and install the Windows Phone Developer Tools in order to test in IE on the emulator. I don't know about Whine, but I ran into major problems trying to test in Parallels - so based on my experience, I suggest keeping it as simple as possible.
There is no console in IE on the phone, so you will need to use alert, like you suggested, or just write text to a div on your page as a custom console.
If you really want to code in OS X (which I definitely understand), using a separate machine for testing IE in the WP7 emulator is going to be your best bet.
EDIT: I just tested alert and it did work fine on my Windows Phone. My guess is that a syntax error is preventing it from calling.
The following may be interesting
Simple IE debug tool for Windows Phone
Supports
Html traversing
Html node styles, properties, metrics
Reading console output
Executing js on device side from console (including intellisense)
Dynamic script injection - ability to debug live sites
Not supported
js breakpoints
Just wanted to add a note to say that full JavaScript debugging is possible now with Windows Phone 8.1 and Visual Studio 2013 Update 2. Full details are available at:
http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/04/diagnosing-mobile-website-issues-on-windows-phone-8-1-with-visual-studio.aspx
I realize that this doesn't help the versions referenced in the original question (WP7), but I'm hoping this will help people who may find this question and are running a more recent version.
Something that has worked for me, is to test my mobile pages through the Windows Vista built-in Internet Explorer browser.
It comes with a script debugger ( which you have to enable in Advanced Options tab through the Internet Options menu ), and it seems that it gets really close to the Internet Explorer Mobile implementation.
Another tip would be, that, instead of using window.alerts, you can also use document.write or set output to a div content.
I'm using this hack to have console.log send info back to the server (it uses window.fetch, which I'm polyfilling, but could use xhr instead) https://gist.github.com/wheresrhys/bf93057ee3a594454582

How to debug Javascript running in a webview on an iPad?

I have an iPad running some Javascript in a webview, but sometimes it just refuses to work. Does anyone have a way to debug this kind of issue?
You can use bookmarklets to run things like firebug lite: Check the following article for links to how to make bookmarklets installable on mobile safari as well as links to firebug lite.
http://community.godaddy.com/library/setting-up-a-debugging-environment-on-the-ipad/
Recently with the new iOS 6 you can turn on remote debugging and analyze your project with Webkit Inspector on Safari (but only with a Mac, because you must have safari 6.x).
This method would not work on the first generation of iPad too, because they're not upgradeable to iOS 6.
The question is one year old and obviously it wasn't available at the moment. I'm posting it so that someone who come up here could know it.
Info: http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
Another tool you could try is adobe shadow.
Simply enable js console

Android 2.1 Browser Javascript Problems and Suggestions

I asked a question yesterday that has gone unanswered. So I will just ask this:
What advice can you give me about Android 2.1 Web Browser and Javascript? How do you debug errors? What things do you avoid doing? What things do you make sure to do?
In a lot of ways, the Browser behaves like Mobile Safari on iOS devices. I need help with what makes it different from iOS devices.
The Android SDK is freely available, and includes an emulator that will allow you to run the browser that comes with the OS. So, you can test your site directly in an emulated device, if you don't have a device available.
There are some features for debugging via the SDK as well, see here:
http://developer.android.com/guide/webapps/debugging.html
Surely if it works in firefox etc and you have no errors via firebug then it should be fine. But you could try using firebug lite to debug any errors.
I know it this works even in IE6 so it should work in the Android browser.

Categories