How to make the opened Page/Tab open in Foreground (Active Tab)?


leeuniverse

Recommended Posts

I have an HTML page open in a Panel.... There are links/images that open up pages into a tab.

How do I make that page/tab to be forced to show as the Active Tab, i.e. in the Foreground?

I have some old code from Maxthon Classic that used to work (though the last couple of versions you had to change a setting or two in the Maxthon options if I remember right). So, here that is also if any of it might help.

Here's the code on the main page, the one with the icon's you click to open up the window with the game. One thing though, I used to have a "Mute" button, so I don't know if all the code on this page is for the Mute button, or if only some of it is. But, I'll post it anyway to look at. The next code I post (code from the game page itself that pop's up), might be the code that made the page go to the foreground.

function executeCommands(inputparms)

{

// Instantiate the Shell object and invoke its execute method.

var oShell = new ActiveXObject("Shell.Application");

// Change the Hard Drive Location of Mute.exe here, keep same formating.

var commandtoRun = "e:\\Program Files\\Maxthon\\Plugin\\UltimateGames\\mute.exe";

if (inputparms != "")

{

var commandParms = document.Form1.value;

}

// Invoke the execute method.

oShell.ShellExecute(commandtoRun, commandParms, "", "open", "1");

}

Here's the code from the game page itself that pop's up, the one that needs to be in the foreground, aka the Active Tab.

// written by Tara

function blkErr() {return true;} onerror=blkErr;

function goToTab() {

var tbC = external.tab_count;

var tbUrl;

var pFolder = external.m2_plugin_folder(max_security_id,"Ultimate Games");

var fPath = "file://" + pFolder + "x227.html";

fPath = fPath.toLowerCase();

fPath = fPath.replace(/ /g,"%20");

for (i=0; i

tbUrl = external.get_tab(max_security_id,i).document.URL.toLowerCase( );

if (tbUrl == fPath) {

external.activate_tab(max_security_id,i);

}

}

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.