How Can I Write Cross-Browser Links?
October 25, 2005 12:13 PM   Subscribe

Without using any plug-ins or extensions, how can I always force a link to open in IE, regardless of the client browser?

I'm trying to do a fairly simple web port that has three existing ActiveX ojbects that aren't about to get re-written. Of course it works fine in IE but doesn't in Firefox. I've already implemented some browser detect code that tells people "get thee to IE" if they try to launch the pages containing the ActiveX objects.

What I'd prefer, though, is some kind of client-side link that allows any user the same kind of functionality that Firefox's "View In IE" plugin does. The ActiveX objects launch in a new, untitled, no-scrollbarred window anyway -- I'd like to be able to force those links to always open in Internet Explorer instead of the default browser. A much more seamless user experience that way.

Is it even possible to do this programatically? Or am I going to have to stick with providing browser-specific directions throughout the web app, stating that it works best in IE? Thanks.
posted by RKB to Computers & Internet (9 answers total)
Since I don't have IE installed on this computer, it's going to be tough for you.
posted by jellicle at 12:20 PM on October 25, 2005

Not from a Web page, no. You could send 'em a shell script that invokes iexplore.exe with the proper URL, but who in their right mind is going to execute a shell script sent to them by a Web site?
posted by kindall at 12:23 PM on October 25, 2005

Kindall: The only users who would execute a shell script sent to them by a web site would probably be using IE already. *rimshot*

To echo the others, not possible and not a good idea even if it were possible.

You have no plans to upgrade these ActiveX items? What happens when you find bugs or need new features?
posted by unixrat at 12:28 PM on October 25, 2005

Best answer: I think the best you can do is use a piece of javascript to recognize the browser and act accordingly. That is, if in IE, go ahead, if in anything else display a message warning the user the link will only work in IE. An alternative, not always acceptable, is to disable (or even vanish with) the links if the containing browser is anything but IE (this way you account for Linux users who will not be able to view it IE anyway).
posted by nkyad at 12:40 PM on October 25, 2005

posted by electric_counterpoint at 12:55 PM on October 25, 2005

Response by poster: Thanks, all, for confirming what I'd already suspected. I'm doing something similar to what nkyad suggests -- the links that launch the ActiveX pages are replaced with friendly text messages, so, theoretically, people shouldn't be able to launch those pages unless they're in a compatible browser.

I suspect it's a small percentage of the audience, frankly, that will be using this site anyway. It's a corporate app for a corporate audience: they fit well into that 90% market share for IE. That's why the ActiveX controls were built in the first place, instead of a nice Javascript alternative.

So, until they decide it's worth the investment to convert the apps, there will be no direct cross-browser linkage!
posted by RKB at 12:55 PM on October 25, 2005

You could have the links point to a file like foobar.mht (mht is a type of archive you can save pages as from explorer), which would (usually) cause Firefox to pop up a dialogue asking if it's okay to open that link with explorer, though that would probably just scare visitors. There's no way (unless there's some exploit out there) to have Firefox open a link in explorer automatically since that would give Firefox all the same vulnerbilities as explorer.
posted by bobo123 at 2:49 PM on October 25, 2005

Can other browsers consume .htc behavior files? If not, that would be another way to make sure only IE was opening it, but I don't know what would happen if other browsers tried. They might get a text file or it might try to find an associated application (IE).
posted by yerfatma at 6:51 AM on October 26, 2005

Firefox opens up .mht files as a page of ascii text for me - no "what should I do with this file" dialog.
posted by blag at 4:29 PM on October 27, 2005

« Older Unloading a loaded mutual fund   |   Die Zeitung! Newer »
This thread is closed to new comments.