Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 846897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:41:30+00:00 2026-05-15T06:41:30+00:00

We are using software that registers its own protocol. We can run application from

  • 0

We are using software that registers its own protocol. We can run application from browser then by link like:

customprotocol://do_this.

but is there a way to check is such custom protocol supported by user`s system? If not we would like to ask user to install software first.

E.g:

if (canHandle ('customprotocol')) {
     // run software
}
else {
    // ask to install
}

Edit
I know about protocolLong property but it works only in IE.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:41:31+00:00Added an answer on May 15, 2026 at 6:41 am

    Unfortunately, there’s no easy way of achieving this. There’s certainly no method of pre-determining whether or not the protocol handler is installed.

    Internet Explorer, as you mentioned, has the protocolLong property but I’m having trouble getting it to return anything other than “Unknown Protocol” for all custom protocol handlers — if anyone knows how to get IE to return the correct value please let me know so I can update this section. The best solution I’ve found with IE is to append to the user agent string or install a browser extension along with your app that exposes a Javascript accessible property.

    Firefox is by far the easiest of the major browsers, as it will allow you to try and catch a navigation attempt that fails. The error object returned contains a name property whose value is NS_ERROR_UNKNOWN_PROTOCOL:

    try {
        iframe.contentWindow.location.href = "randomprotocolstring://test/";
    } catch(e) {
        if (e.name == "NS_ERROR_UNKNOWN_PROTOCOL")
            window.location = "/download/";
    }
    

    Firefox will pop up with its own alert box:

    Firefox doesn’t know how to open this address, because the protocol (randomprotocolstring) isn’t associated with any program.

    Once you close this box, the catch block will execute and you have a working fallback.

    Second is Opera, which allows you to employ the laws of predictability to detect success of a custom protocol link clicked. If a custom protocol click works, the page will remain the same location. If there is no handler installed, Opera will navigate to an error page. This makes it rather easy to detect with an iframe:

       iframe.contentWindow.location = "randomprotocolstring://test/";
       window.setTimeout(function () {
           try {
               alert(ifr.contentWindow.location); 
           } catch (e) { window.location = "/download/"; }
       }, 0);
    

    The setTimeout here is to make sure we check the location after navigation. It’s important to note that if you try and access the page, Opera throws a ReferenceException (cross-domain security error). That doesn’t matter, because all we need to know is that the location changed from about:blank, so a try...catch works just fine.

    Chrome officially sucks with this regard. If a custom protocol handler fails, it does absolutely zip. If the handler works… you guessed it… it does absolutely zip. No way of differentiating between the two, I’m afraid.

    I haven’t tested Safari but I fear it would be the same as Chrome.

    You’re welcome to try the test code I wrote whilst investigating this (I had a vested interest in it myself). It’s Opera and Firefox cross compatible but currently does nothing in IE and Chrome.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 488k
  • Answers 488k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Send a key event of type KCODE_DPAD_DOWN. To send an… May 16, 2026 at 8:46 am
  • Editorial Team
    Editorial Team added an answer This should be entirely PHP controlled, not by WAMPServer or… May 16, 2026 at 8:46 am
  • Editorial Team
    Editorial Team added an answer StickNotes data file is a Compound File (a filesystem within… May 16, 2026 at 8:46 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've got a Java application that I'm writing an installer for. We're using the
I am using a master page... Then there is an .aspx that uses this
I'm writing some software that automatically connects a Bluetooth device using the Windows Bluetooth
I'm using a pretty simple install script for my application and its showing an
SUMMARY How can I make my GUI application run on windows startup on a
On the server I would like to call into a dll from php. Using
I have existing managed and unmanaged software using an ActiveX component supplied by a
I'm trying to delete a registry from the Local_Machine\Software in the registry. I made
Assume that you have a running SQL Server Express instance named (local)\SQLEXPRESS. Its database
I'm running a process from inside a windows service using: ProcessStartInfo processStartInfo = new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.