Topic: External Protocol Detection? Pages that link to <a href="https://ozoneasylum.com/backlink?for=28020" title="Pages that link to Topic: External Protocol Detection?" rel="nofollow" >Topic: External Protocol Detection?\

 
Author Thread
iangilman
Neurotic (0) Inmate
Newly admitted

From:
Insane since: May 2006

IP logged posted posted 05-31-2006 21:54 Edit Quote

I'm creating a Windows application, and I want to be able to launch it with specific URLs from web pages. My installer registers (in the Windows registry) an external protocol for the browser (i.e., myprotocol://), and both IE and Firefox launch the app properly.

My question is this: Is it possible from within the web page (i.e., with javascript) to detect whether that external protocol is available? I have not found an explicit method for doing so. I have also tried attempting to launch the URL with the external protocol and catching all errors. On Firefox the error is caught, but not until after it displays an "unknown protocol" message to the user, which I've been unable to suppress. On IE, no error is caught and the user is taken to one of IE's "I can't open this page" pages.

Any ideas would be greatly appreciated!

Thank you,
-- Ian

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 05-31-2006 22:51 Edit Quote

If you are going to have enough access to the user's machine to change their registry settings you might find it easier to create a small plugin that would be installed (much like flash) that you can then check if that is installed in a similar fashion as you would check for the flash plugin.

I can not think of a way that you would be able to perform a test on protocol support so I can't be of any help on that.

Dan @ Code Town

iangilman
Obsessive-Compulsive (I) Inmate

From:
Insane since: May 2006

IP logged posted posted 06-01-2006 18:43 Edit Quote

Dan,

Good suggestion. I'd like to find something more lightweight, if possible, but that's a good fallback.

Another thought: Is there any way, from an external installer/application to stuff a cookie into a web browser?

Thank you,
-- Ian

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 06-01-2006 20:47 Edit Quote

I am sure there is.

IE Cookies are stored in C:\Documents and Settings\[username]\Cookes and are one file per cookie.

FF Cookies are stored in C:\Documents and Settings\[username]\Application Data\Mozilla\Firefox\Profiles\[profile]\Cookies.txt and all the cookies are in this one file.

You would have to have a program create an entry in there.

The problem with relying upon a cookie is that if the user deletes the cookie (which is not that uncommon) then you will have lost your hook into knowing if your application has been registered.

Dan @ Code Town

iangilman
Obsessive-Compulsive (I) Inmate

From:
Insane since: May 2006

IP logged posted posted 06-05-2006 23:38 Edit Quote

Dan,

Good point. Thanks for the info. I think I'll pursue the plugin approach.

-- Ian

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

IP logged posted posted 06-18-2006 06:59 Edit Quote

Just a question, though: why do you need to check for this protocol? If your program's installer is what registers it in the first place, you should be able to detect if it doesn't take in the registry in the first place, and refuse to continue the installation.


Justice 4 Pat Richard

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 06-18-2006 08:44 Edit Quote

I am imagining the situation that a user visits the target website. If they have installed the program they will be shown the appropriate links for the application. Otherwise a message to download the application will be presented.

Dan @ Code Town

divinechaos
Nervous Wreck (II) Inmate

From:
Insane since: Dec 2001

IP logged posted posted 06-19-2006 09:46 Edit Quote

Could you extend the browsers' javascript environment with a function or object you can check for? If it's present, the protocol is supported, otherwise it dies?

I would then write the links page (to the installer), and have the javascript replace the content with the "protocol is installed" content if the test succeeds, either via stright DOM injection (have the alternate content ready to load) or AJAX (query the server for alternate content).

Don't forget to add some small "I-have-js-off-but-have-the-MAGE-protocol-installed" link at the bottom.

I'm not certain about IE, but I'm fairly sure FF and OP could manage something of the like.

Cheers,
DC

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

IP logged posted posted 06-19-2006 12:04 Edit Quote

Except that this isn't the target website he appears to be talking about. This protocol that has been installed links to the program itself, loading up its web-page control panel or whatever. If you try to access that protocol (not detect it) then both firefox and IE throw a wobbly if it's not installed.


Justice 4 Pat Richard

divinechaos
Nervous Wreck (II) Inmate

From:
Insane since: Dec 2001

IP logged posted posted 06-20-2006 06:53 Edit Quote

I understood, but you could install your javascript hook at the same time you install the program; much like various plugins used to explicitly install to selected browsers.

Cheers,
DC

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

IP logged posted posted 06-21-2006 09:18 Edit Quote

Sorry, divinechaos... that wasn't about your post, it was about WarMage's


Justice 4 Pat Richard

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

IP logged posted posted 06-27-2006 20:43 Edit Quote

Isnt it possible to see if file:///c:\smalljs.htm exists within javascript? like if an iframe is able to load the htm file. Just a thought, not sure if it would work or is anything like what your after.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu