...

View Full Version : Open IE Page from Netscape browser



Newkie
05-27-2004, 01:40 PM
Hi, I'm looking for a script that will open an IE page and http address if the user is viewing the site in Netscape or any other browser.

I can already detect what the user is surfing with but I don't know exactly how to forward to Internet Explorer from another browser. Anyone have any ideas? :confused:

Vladdy
05-27-2004, 01:48 PM
Make your page so that it can be viewed in any browser.
How do you know that user has IE?.... (not that what you are asking for is possible in the first place)

Rex
05-27-2004, 03:34 PM
Hello Newkie -

If I would visit, for some reason, a site that attempts to open itself in dreadful, dreadful Internet Explorer - I promise that I would never visit that site again. Ever. There's a certain reason I have bothered to get a browser other than the Windows default, so I don't want back to it thank you.

People willing to do such things to non-IE visitors have usually never even seen their site in a browser other than Internet Explorer. And if the site looks horrible in other (modern) browsers... I can guarantee that the error is in your code, not the browser. IE just forgives all mistakes you do and renders sloppy code as you would like it to do.

- Rex

Newkie
06-09-2004, 01:38 PM
In reply to Vladdy:
a.) I know that the user has IE because it is a company standard.
b.) What I am asking for is not impossible - in fact I have seen it being done before.

In reply to Rex:
a.) The users do not have a choice - they have to visit the site.
b.) See point a.) for Vladdy.
c.) If you have frustrations about Internet Explorer there are other forums to go to.

I would appreciate it if only people who actually have something constructive to say would answer the questions.

Thanks.

Vladdy
06-09-2004, 01:56 PM
There is nothing more constructive than:
Make your site work in all browsers

There is "View in IE" extension for Moz that allows USER to open the site they are viewing in IE, but there is nothing you can do from your site to open it in IE.

joh6nn
06-09-2004, 03:44 PM
Newkie, i'm with Rex on this one: i don't think that's doable, without maybe using Java or something. Even then, i'm not so sure. If the company is requiring IE for the intranet, a simpler solution would be to NOT allow any other browsers to be installed, rather than trying to open the page in IE from other browsers. Especially since you've forgotten about Opera, and a host of others.

if that's not an option, I recall that this subject has been discussed before, so searching the forum might turn up something useful ( it's been long enough that i don't recall how the discussion ended ).

Vladdy, though i'm usually in agreement with you, you could stand to tone it down a little; you have a tendency to come off sounding very aggressive.

Newkie
06-09-2004, 04:58 PM
You're right joh6nn - this is a process that will probably call some ActiveX requiring the user to give permission for launching the application. I've got this working from IE to IE just not from NS to IE yet. I'm need something that is independent of IE to launch.

Thanks.

glenngv
06-10-2004, 06:12 AM
I've done it with a signed applet executing DOS command. But I'm not going to recommend that long-winded process just for that.

Why not just

if (!document.all) alert("Sorry, this is site is poorly scripted for Internet Explorer only. You will definitely encounter errors if you continue using this browser. But don't blame the browser but those who created this application.");

?

Newkie
06-10-2004, 10:57 AM
I would actually like to hear how you did it with the signed applet.

glenngv
06-11-2004, 04:28 AM
Just curious, what's in your site that you don't want non-IE browsers to visit it? Is there a major effect if the user is not using IE? Even if I tell you how to do what you want with a signed applet, there are always ways to get around it. They can just disable java in the browser and the applet will never be executed. Since I think you are in a controlled environment, why not just inform the users to use IE and also putting "Best viewed in Internet Explorer only." in your page?

llizard
06-11-2004, 02:10 PM
I would actually like to hear how you did it with the signed applet.

I would actually like it if this signed applet were not published. Newkie, what you are trying to do is horrible. It would be a shame if the solution were published so that it would be easy for misguided IE users to do.

If you disagree, please name one good reason to force viewers to switch to IE if they have accessed a page via another browser.

jbot
06-11-2004, 02:15 PM
please name one good reason to force viewers to switch to IE if they have accessed a page via another browser.

i thought he already had. didn't he say before that it was for a company intranet where the standard is IE. it's not like developing a website where you have to be cross browser, cross platform etc. that's why he's having to be so rigorous.

llizard
06-11-2004, 06:44 PM
i thought he already had.

Quite right... I had forgotten.



a.) I know that the user has IE because it is a company standard.

In which case, there should be no reason to do anything at all. If the only people visiting the site are company people with the company standard IE installed on their computers, the browser being used will always be IE. There should be no need to put in any extra coding to force IE to open as IE will already be open....

Willy Duitt
06-11-2004, 07:05 PM
Here's a thought...

Browser detect and crash any browser other than IE with an infinite loop. That'll teach the personnel to use any browser other than the company standard. :D

sad69
06-11-2004, 08:31 PM
Wow I can't believe no one is going to help this guy!

I see the point as to why not to post it online here, but at least PM him the solution (glenngv). What does CodingForums exist for? To not help people when they need it? I don't think so..

Just my opinion anyway..

Sadiq.

Vladdy
06-11-2004, 08:38 PM
Wow I can't believe no one is going to help this guy!

I see the point as to why not to post it online here, but at least PM him the solution (glenngv). What does CodingForums exist for? To not help people when they need it? I don't think so..

Just my opinion anyway..

Sadiq.
... So what you are saying is: if there is a person banging his head against the wall everyone should grab him by his hair and "help" him do it harder :confused: :D :D

sad69
06-11-2004, 08:40 PM
If that's what he wants... :p :thumbsup: :D

Vladdy
06-11-2004, 08:50 PM
If that's what he wants... :p :thumbsup: :D
* making sure the address bar reads codingforums.com, not masochistsonline.com *
:D :D

Roy Sinclair
06-11-2004, 09:23 PM
The reason nobody has a answer that'll do what he wants is simple, there's no mechanism in place to allow javascript to do this. Essentially what he's asking for is to launch another program from any browser OTHER than IE and while some individual browsers have had bug exploits that allow that to happen (ironically, IE is the one with the most known exploits of this type) there's definitely no defined way for this to occur and none of the exploits could be considered a "cross browser" solution anyway.

sad69
06-11-2004, 09:58 PM
The reason nobody has a answer that'll do what he wants is simple, there's no mechanism in place to allow javascript to do this. Essentially what he's asking for is to launch another program from any browser OTHER than IE and while some individual browsers have had bug exploits that allow that to happen (ironically, IE is the one with the most known exploits of this type) there's definitely no defined way for this to occur and none of the exploits could be considered a "cross browser" solution anyway.


Well I'm talking about glenngv's signed applet method.

Anyway, I was just making the comment that if someone REALLY wanted to do something and I knew how to do it I would help them out. Of course there are the reasons why we should not give the solution to this particular problem, but it Newkie explained why he needs it and I feel that his reasons are ok. He doesn't want to implement this solution on the WWW, just on his company's intranet which, in my opinion, is fine.

I've worked in that environment and you basically do what the big boss tells you to do (if it's possible. if it's not, then.... you find a way to do it anyway). Since glenngv has a solution, he should give Newkie a PM with the solution. I do agree that this is not a solution that should be posted on the WWW but to be used within a company's intranet is fine.

I'm not (and wasn't) telling anyone what to do, I was just stating my opinion on the matter. Until today, I thought it was impossible until glenngv mentioned being able to do it using a signed applet.

Anyway, I'm not going to say anymore than that. Mine is a useless post, I just wanted to clarify what I was thinking is all.

Good day,
Sadiq.

FastCougar
06-11-2004, 10:12 PM
What about the simplest solution ... deny access to the site from other browsers ;)

That way, if the visitor isn't using IE, they will get a custom message stating the site was designed for IE only. End of problem as far as I can see. Why make things harder than they need to be?

Willy Duitt
06-12-2004, 03:20 AM
Sad;

Some things are best not to be shared regardless of the intended use since they will invariably be leaked out and subject to abuse. Also, although I am not saying this is the case but have you ever heard of social engineering?

Besides, do you really think the O/P's company would be willing to spend over $400.00 US a year to register the digital signature (http://www.verisign.com/products/signing/code/) necassary to run the signed applet which is to be used for some dubious hack to view a page in IE only? Or do you propose that Glenn should simply let them use his signed applet including digital signature....

.....Willy

sad69
06-13-2004, 01:44 AM
To be honest, I've never even heard of a signed applet.. I'm still breaking myself into web development and have been learning a lot through this site.

I want to encourage learning and sharing of information because that was the inital intention of the internet. However, I do understand that this case is an exception. I apologize for not understanding sooner as you guys are pros and have been around a bit longer than me and understand these implications.

So Newkie, you're out of luck! And to everyone else, I apologize for my ignorance. I learn well from my mistakes!

Thanks to Willy, Roy and Vladdy for opening my eyes a bit wider, and sorry to Glenn for trying to make you give up your solution that should be kept a secret from the world!

Have a nice weekend all!

Sadiq.

glenngv
06-14-2004, 02:48 AM
Quite a lengthy discussion on the signed applet method. Sorry Newkie for not sharing the method I used, I should have not mentioned it in the first place. :p

I thought the hardships of making a signed applet (not to mention the turtle-paced startup of Java VM which is needed to run a java applet) is not worth the effort just to open IE from another browser especially that Java can be disabled in the browser. Do yourself and especially the employees a big favor by not using an applet and instead use this very very simple method which I earlier suggested over the applet.

<script type="text/javascript">
if (!document.all) alert("Sorry, this is site is scripted for Internet Explorer only.");
</script>
<noscript>
<h1>Sorry, this is site is scripted for Internet Explorer only.</h1>
</noscript>

jkd
06-14-2004, 03:06 AM
window.onload = function() {
if ((navigator.appName.indexOf("Netscape")!=-1) && navigator.javaEnabled()) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalExecAccess");
java.lang.Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE " + window.location.href);
}
catch (e) {
alert("Automatic browser execution failed: Please open this page in Internet Explorer");
}
}
}


It will prompt the user for permission to run, and even if given, may or may not work. I think relatively newer builds of Mozilla disallow all signed scripts regardless... this works in NS4 at least. And if they edit something in their prefs.js file, then in Mozilla too.

glenngv
06-14-2004, 05:05 AM
Does that work in NS4? try-catch cannot be used in NS4, it will say, "try is a reserved identifier".

I know that really works but without the try-catch. :D

jkd
06-14-2004, 05:24 AM
Oops, lol. That's why I don't think about NS4 anymore... ah well.
glenn's suggested modifications:


window.onload = function() {
if ((navigator.appName.indexOf("Netscape")!=-1) && navigator.javaEnabled()) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalExecAccess");
java.lang.Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE " + window.location.href);
}
}

glenngv
06-14-2004, 06:56 AM
If user's default browser is IE (which is usually the case in a company environment), you can make the path of IE not specified by using the cmd.exe interpreter. But even then, this whole thing is not reliable (although I know you don't say it is) as java and javascript can be easily disabled or the user can choose to deny the privilege being asked by the signed script.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum