Need Help Determining a Browser's Network Protocol Support

| | | |

I'm working on adding apturl support to Linux App Finder so programs in a deb repository can be installed just by clicking a link. Since not every system will have apturl installed, I'd like to be able to detect whether or not the browser can handle an apt: link and use the information to display appropriate instructions. Does anyone know how to do that?

Right now I plan to have two potential links. The primary one will say Install Now and have an apt:packagename formatted link. The other will link to instructions on how to setup apturl and install apps directly from your browser.

The checks I currently have planned are:
- Determine that Linux is the OS
- Determine whether there is a handler for the apt: protocol.

apturl currently only supports Firefox and is in the Ubuntu Gutsy Gibbon repositories. Synaptic is required as well, although it doesn't appear to be listed as a dependancy. Hopefully the apturl team can remove their dependancy on Synaptic in the future because it adds unnecessary overhead to the installation.

apt: support is registered in Firefox through the resource in the /usr/share/firefox/defaults/pref/ file. My problem is that I can't figure out how to access that setting through javascript. If anyone has some ideas to determine whether or not the browser knows how to handle the apt: protocol please let me know.

Even though Firefox is the only supported browser right now, I'm also looking for ways to detect apt: handling in Opera and Konqueror. I expect that they will be supported in the future.


Did you ever come up with a solution to this?

Unfortunately, no. I wanted

Unfortunately, no. I wanted to display something different for the Install Now link if apt:/ wasn't supported, but I never figured out a good way to do it.


I couldn't find a way to do it either. I thought perhaps using JS to try and load an image over the protocol might work, or opening an ajax link to that protocol might do it, but nothing worked as I might have hoped :/

Oh well!

No Solution?

I know this post is old but have you found anything since?

From the research I've done it seems impossible to detect support for specific URI schemes and Protocol Support but in your case, you could check to see if the browser "plugin" is available...

loop through window.navigator.plugins and figure out if the specific "apturl" plugin is there.

I never did find a good

I never did find a good solution. I haven't looked through plugins though. Right now the link is displayed by default regardless of whether or not the user's system can use it. I may go mess around with it some more at some point since it would be less confusing for people to not have a useless link appear if they aren't on a deb based system.