Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Issue 157028 Unable to recover from unknown URI Schemes in javascript
Starred by 8 users Reported by, Oct 21 2012 Back to list
Status: Fixed
User never visited
Closed: Jan 2013
EstimatedDays: ----
NextAction: ----
Pri: 2
Type: Bug

Sign in to add a comment
Steps to reproduce the problem:
Here is a javascript code block that should reproduce the problem.

<script language="javascript" type="text/javascript">
setTimeout(function() {
	if (!document.webkitHidden)
	window.location = "";
window.location = "myapp://doSomething";

What is the expected behavior?
If the app is not installed the user should be redirected to the store link. If the app is installed it should open the application.

What went wrong?
The javascript code [document.webkitHidden] never runs because upon failure to launch the custom uri scheme, Chrome seems to hard fail to another document that states "Chrome cannot open this URL.  The requested URI Scheme is not supported."

Did this work before? N/A 

Chrome version: 21.0.1180.82  Channel: stable
OS Version: 6.0 (iPod, iPhone, iPad)

I normally wouldn't say anything but there are a lot of application developers/web developers that use this design pattern to redirect people to their applications.  In all other webkit based browsers this code works (including chrome on android where the same design pattern is used with custom url schemes and intent filters)

Ideally, to fix this solution, javascript would need to throw an exception error when failing to navigate to a url or provide a set of javascript methods for launching apps from the browser.  I'm guessing this will probably not happen anytime soon for any browser so I'm not going to hold my breath.

In the interim maybe something more traditional like using the alert instead of the hard fail page, or maybe something as simple not running the exception check if the uri fails in an iframe.
Labels: -Via-Wizard Area-Internals
Status: Available
Tracked internally as b/7432105.
Comment 2 by, Dec 7 2012
similar issue:

    function openInIframe() {
        document.getElementById('appLauncher').src = 'unknown_uri_scheme://open';
<button onclick="openInIframe()">open native app. in iframe</button>
<iframe id="appLauncher"></iframe>

    open unknown url scheme in iframe.

    unknown url scheme has been opened in main window(not iframe)
Any updates on this issue? It is breaking the standard iOS solution for Open In App buttons.
Labels: Mstone-25
Status: Fixed
This has been fixed internally, it should roll out with our next release (M25). We now fail silently just like desktop chrome if set to a uri scheme that's unsupported.
Fantastic! Thanks for getting this fixed.
Thanks from me too!
 Issue 170728  has been merged into this issue.
Project Member Comment 8 by, Mar 10 2013
Labels: -Area-Internals -Mstone-25 Cr-Internals M-25
Comment 9 by, Mar 26 2013
This bug appears to exist on Chrome for Android - tested on latest release 25.0.1364.169.
Please file a separate bug; this was a bug in iOS-specific code, and was fixed.
Comment 11 by, Mar 26 2013
Will do - for some reason I can't submit a new bug - keep getting "400. That’s an error.  Your client has issued a malformed or illegal request. That’s all we know."  Tried both Chrome on OS X and Firefox with the same result.  I'll try again later in case there's a temporary problem with Google's servers...
Comment 12 by, Mar 26 2013
Okay waiting worked - was able to file a new bug:
Sign in to add a comment