foregroundBrowser - web automation property

Returns a web automation library Browser object attached to foreground Internet Explorer instance (the IWebBrowser2 with which the user is currently working).

Applies to:
  var b = coreObj.foregroundBrowser;
The property is null if no Internet Explorer browser is in foreground. The property returns a web automation Browser object that matches the search condition arguments and gets programmatic control over the IWebBrowser2 underlying IE native object. This IE automation property works for all Internet Explorer versions: IE6, IE7, IE8, IE9 and with IE protected mode on Windows XP, Vista and Win7.
// Make the foreground browser to navigate; start a new browser if there is no browser in foreground.
var coreObj = new ActiveXObject("Twebst.Core");
var b       = coreObj.foregroundBrowser;

if (b == null)
	// No foreground browser.

	b = coreObj.StartBrowser("");
See also:
Browser | Core | FindBrowser | StartBrowser

© 2014 CodeCentrix Software. All rights reserved.