Forum Moderators: open

Message Too Old, No Replies

How to force a specific browser

Certain behaviors rely on IE. How can I direct a link to a specific browser?

         

broniusm

3:39 pm on May 23, 2006 (gmt 0)

10+ Year Member



Is there a way to provide a button or link that opens a url in a specific browser, specifically Internet Explorer?

There is a nifty IIS-provided service that initiates the installation of a remote printer on a client. I've not explored the underlying technology (likely ActiveX) but at any rate it does not work in non-IE out of the box.

thanks

broniusm

3:40 pm on May 23, 2006 (gmt 0)

10+ Year Member



some misleading ideas I thought of but couldn't prove/disprove:
- some IE-magic in target attribute?
- open a file:/// link and force an explorer/iexplorer session, then immediately redirect that browser to the printer installation url?

rocknbil

5:07 pm on May 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Rather than to do a browser identification, test for the objects used by these methods with Javascript. This will allow any other browsers that support those objects to . . . .well, use those objects.

A crude example in another context is document.all, which is an IE-specific method. If you want to manipulate divs (layers by an old name) then

if (document.all) {
// go for it in IE!
}

This will not only allow IE to use this stuff but if any other browsers can, they will. It also avoids having to come back to this years later and update your browser ID methods, which becomes quite a nightmare.

broniusm

5:24 pm on May 23, 2006 (gmt 0)

10+ Year Member



Thanks, and browser-sniffing is certainly a good idea to provide a good message to the user.

What I'm looking for, however, is a seamless method of allowing the user to click (from whatever browser) a link and get specifically IE. When a user gets our free wifi, we want him to be able to very brainlessly install a printer on our network to use. IIS provides that function, but it's an ActiveX object (instanciated in vbscript, no less..).

thanks

encyclo

9:36 am on May 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is nothing in HTML that you can use to open a page in a specific browser - and what happens if the person is a Mac or Linux user and doesn't have IE installed at all? :)

As ActiveX won't work outside of IE, you could make a page using IE conditional comments [msdn.microsoft.com] to display either the IE-specific code or a warning notice to reopen the page in IE.

broniusm

1:11 pm on May 25, 2006 (gmt 0)

10+ Year Member



Thanks. I guess that's really all there is, then. I'll also print up some small cards to put near the printing station with simple, basic instructions: using IE, open this url... And with a little sniffing on the page, I should be set.

rocknbil

7:24 pm on May 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



bronius it's going a bit off topic but you **don't** want to do a browser type ID for the reasons I mentioned. What if your browser id doesn't work next revision, or next, or next? Find some object specific to the browser you want to target and use the object, not browser UA or version.

broniusm

8:07 pm on May 25, 2006 (gmt 0)

10+ Year Member



Find some object specific to the browser you want to target and use the object, not browser UA or version.

Ah right.. good to be clear on that-- I perhaps used "browser sniffing" too liberally whereas I agree it's best to use the more direct "does this specific function work" method. Good call rocknbil.