Starting DEFAULT system browser from within IE window

D

David

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>");
 
V

VK

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.
 
S

scripts.contact

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top