Scott Hanselman

A Better Way for ClickOnce and FireFox

March 22, '07 Comments [6] Posted in ASP.NET
Sponsored By

I blogged a few years back about how I was disappointed that ClickOnce didn't work in FireFox, and about a year ago Saurabh (MSFT) wrote a response.

"There have been Plugins written by the FireFox community
[e.g.
http://www.softwarepunk.com/cohelper/] where they parse the application after it has been downloaded and read the deploymentProvider Url from it. They then use the undocumented Apis for invoking ClickOnce with the URL as a parameter [rundll32 dfshim.dll,ShOpenVerbApplication URL ]. I have never tried the approach above, but would believe it works.
From the ClickOnce teams perspective we would advise users against parsing the ClickOnce manifest and relying on its format for we could inadvertently break you in future manifest updates. Also since the <deploymentProvider> tag is only needed in Shell Visible installed ClickOnce applications this solution does not work for Online ClickOnce Apps.

For out next release we are looking into what we can do to provide a simple public way for the FireFox community to build plugins for ClickOnce support. Stay tuned ..."

I'm still waiting for direct XBrowser support, but I can report that FFClickOnce (James Dobson's Blog) totally works, with both online and offline apps. It makes ClickOnce work in your FireFox browser. There are a few other small add-ins that were attempts at making ClickOnce work, but James' is the most elegant and best tested, by far.

His documentation is impeccable and includes a testing section. It also scans automatically for .NET CLRs on your system and adds them to your FireFox UserAgent - a brilliant touch.

Here's what you see with Firefox 2.0.0.1:

Here's what you see in earlier versions of Firefox:

You can also turn this dialog off in the options for the Add-in and just run the ClickOnce apps directly without the interstitial.

I would encourage everyone who loves both FireFox and .NET to go get the FFClickOnce Extension now.

If you're working on a web application that has a ClickOnce component, I recommend that you include this extension as part of your strategy, and change your web page's flow to something like this:

  • User clicks the "Download Client" link...
  • If .NET CLR exists in the HTTP User-Agent header and it's version is greater than 2.0, issue an HTTP 302 redirect directly to your .application ClickOnce file. Done.
  • If the .NET CLR doesn't exist, redirect the user to a requirements page where they can download the .NET 2.0 runtime directly and then relaunch the application. Done.
    • On this page, if you detect they are running FireFox, link them to FFClickOnce as a prerequisite.

A flow like this will ensure that the user can click Download Client and it will Just Work. It works great for us.

You could also make a new publish.htm page (the static page that is generated when you publish a ClickOnce application, and write Firefox-specific JavaScript to list the installed extensions. This solution seems yucky to me, but would catch the obscure edge-case where the user has FFClickOnce install, but has modified their User-Agent string.

Thanks to James Dobson and Adam Greene for their (direct and indirect) help!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. I am a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Thursday, March 22, 2007 4:54:05 PM UTC
Thanks Scott. I was looking exactly for running my ClickOnce app without relying on IE.
Friday, March 23, 2007 2:46:19 AM UTC
I get a "Add-on not found!" page on the Mozilla site when using the link you provided for FFClickOnce.
Saturday, March 24, 2007 2:41:00 AM UTC
Hi Cory, the link is now working. There seemed to be a 'blip' on the FireFox extension site. cheers! Adam
Saturday, March 24, 2007 3:01:26 PM UTC
Hello Scott,
After your post on Click Once and Mozilla (http://www.hanselman.com/blog/ClickOnceAndFireFoxWithACustomSetupEqualsClickThriceAndBeDisappointed.aspx)
I have tried to contact you via email to tell you about that extension.
I have blogged also on http://serviciipeweb.ro/iafblog/2006/05/24/click+Once+Si+Mozilla.aspx( Attention:Romanian language)

I am happy that you discovered the solution - however, can someone speak with Mozilla guys to integrate the solution by default ?
Tuesday, April 03, 2007 9:30:28 PM UTC
I attempted to use this add-in with report builder and it didn't seem to work. I used the standard http://localhost/reports link and the page came up but when clicking on the report builder button nothing happens. Does report builder do something different?

Thanks
Royal
Royal Hale
Tuesday, April 03, 2007 10:53:43 PM UTC
After further looking into this. .application was assigned to another application to open it. Remove this and it worked.
Royal Hale
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.