By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,882 Members | 2,489 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,882 IT Pros & Developers. It's quick & easy.

Starting DEFAULT system browser from within IE window

P: n/a
Hi All:

Here's what may be a confusing question. I have an application which
has a basic help window that is attached to a Windows application. It
uses IE objects to render html text. The user isn't aware that the
basic help window is an IE window since it has no controls on it.

Within that window, however, are links to "advanced help" pages which
I want to open in a new (full-size) window in the DEFAULT system
browser. The problem is that since the window is being opened from
within an IE window, the new window also opens in an IE window. The
javascript that I am using to open the window is as follows:
document.write("<A HREF=\"");
document.write(helpPage); // The html source page is added here
document.write("\" TARGET=\"AdvancedHelp\">");
document.write(linkText);
document.write("</A>");

Mar 13 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
VK
On Mar 13, 5:23 pm, "David" <dgi...@gmail.comwrote:
I want to open in a new (full-size) window in the DEFAULT system browser.
The default browser is the one currently associated with HTML file
types. This way by directly using rundll32.exe with URL keys you are
guaranteed to launch the browser your user selected as the default one
- given that any browser at all was installed on the current system.
So the task is as simple as to execute:

rundll32 url.dll,FileProtocolHandler http://www.google.com

The line above on Windows platforms will launch default browser
(whatever will it be) and open Google home page in it.

or javascript-ready form:

function openInDefaultBrowser(URL) {
var args = 'rundll32 url.dll,FileProtocolHandler ' + URL;
exec(args);
}

The catch is that you obviously cannot launch local files within the
default security settings. If you can ensure relaxed security
environment then you can use my AL (Application Launcher) script from
www.geocities.com/schools_ring/al.zip

It is very small - just copy-and-paste Shell constructor, then to open
any page in the default browser use something like:

function openInDefaultBrowser(URL) {
var args = 'rundll32 url.dll,FileProtocolHandler ' + URL;
Shell.run(args);
}

AL supports both Gecko browsers and IE, so you can usŐ it at any
stage.

P.S. Many software are using "lazy way" by simply invoking %programs
%iexplore.exe instead of proper rundll32 way
I'm not sure is it a lack of professionalism or some bias. Any way, if
your default browser is say Opera then - clicking "Check for updates"
or something in some application - you can say if the application made
by morons or not. If it opens IE then the sorry truth is yes, it is
made by morons. :-(

:-)

P.P.S. Lesser of course the cases when some IE-specific features are
absolutely necessary on the page to open and when user was informed in
advance that IE is a must to use the application.

Mar 13 '07 #2

P: n/a
On Mar 13, 8:23 am, "David" <dgi...@gmail.comwrote:
Hi All:
Within that window, however, are links to "advanced help" pages which
I want to open in a new (full-size) window in the DEFAULT system
browser. The problem is that since the window is being opened from
within an IE window, the new window also opens in an IE window. The
javascript that I am using to open the window is as follows:

You can use ActiveXObject -

WshShell = new ActiveXObject("WScript.Shell")
WshShell.Run("some Html file path.html") // <- *
*
[url:http://msdn.microsoft.com/library/en-us/script56/html/6f28899c-
d653-4555-8a59-49640b0e32ea.asp]

Mar 13 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.