HelloCW
HelloCW

Reputation: 2235

How can I write code to open multiple webpage in FireFox at one time?

You know , I can save the following code as .js file, and multiple webpage will be opened in different Tab in IE when I double click the js file. How can I do the same thing in FireFox? Thanks!

var navOpenInBackgroundTab = 0x1000;
var oIE = new ActiveXObject("InternetExplorer.Application");

oIE.Navigate2("http://www.google.com");
oIE.Navigate2("http://www.msn.com/", navOpenInBackgroundTab);


oIE.Visible = true;

Upvotes: 1

Views: 2520

Answers (1)

M. Black
M. Black

Reputation: 353

I"m not sure if this is the solution you're looking for but you can do this with a batch file. The *.bat file can be placed anywhere on your computer and when you click it, it will open Firefox with the appropriate browsers:

@echo off
Set URL="www.stackoverflow.com www.yahoo.com www.google.com"
set NewTab=-new-tab
set NewWindow=-new-window
For %%a in (%URL%) Do (Start /d "%programfiles%\Mozilla Firefox" Firefox.exe %Newtab% "%%a")

You could try something like this instead, that would open up in Firefox in a private window (I'm not sure if this is exactly what you're looking for):

@echo off
SET BROWSER=firefox.exe -private-window
SET WAIT TIME=2
@ping 127.0.0.1 -n %WAIT TIME% -w 1000 > nul
START %BROWSER% -new-tab "www.stackoverflow.com"
START %BROWSER% -new-tab "www.yahoo.com"
START %BROWSER% -new-tab "www.google.com"

pause

Upvotes: 2

Related Questions