3

I work on many computers, which means they use default browser settings (There is no point in changing browser settings, because I will have to do it every time). I need to make an HTML file which will open a specific list of desired pages (think of this as opening all my bookmarks). For example I visit facebook, yahoo, and stackoverflow. I want to click that HTML file, and it will open these 3 sites on the same window (different tabs).

Also would functionality like automatic login on all the sites be easy for implementation?

Attention: Focus on a "portable" solution. Assume that you only have default browser settings. No setting up servers, changing browser settings and things like that. Imagine that you have 200 computers and you can sit on any one of them. You have only a flash-drive with some files on it. I want to click an HTML file, or some script or whatever, so that these pages open in my browser, without triggering the popup blocker.

4
  • So you want a local HTML file on your computer, that when clicked, will open multiple webpages? Jan 17, 2013 at 2:39
  • If you're interested in automating, suggest you look at addons.mozilla.org/en-us/firefox/addon/imacros-for-firefox
    – greener
    Jan 17, 2013 at 2:40
  • @matthewpavkov exactly, sorry if it is not clear by my description, English is not my first language
    – lekroif
    Jan 17, 2013 at 2:40
  • @matthewpavkov chrome mostly
    – lekroif
    Jan 17, 2013 at 2:43

5 Answers 5

4

How about using a batch file? I just tried it in Windows 7 with Chrome and it opened all 3 URLs in the same window.

Make a plain text file with Notepad called file-name.bat. Then add this code:

start chrome.exe http://www.google.com
start chrome.exe http://www.yahoo.com
start chrome.exe http://www.microsoft.com

All you should have to do is double click it to run it. You may get a security warning (I didn't).

You could check this out too: Batch file for opening one of a list of URLs

2
  • 2
    Good Job! I didn't know that functionality of batch scripts.
    – lekroif
    Jan 17, 2013 at 3:24
  • This is a decent solution. It's a shame there isn't a more viable solution like a multi-selection in windows explorer followed by opening the files with the default program. Or something of the like.
    – aaiezza
    Oct 27, 2016 at 13:43
1
<script type='text/javascript'>
(function(){
  //add this line for each website you want to open
  window.open("http://www.facebook.com/",'');
})()
</script>

there are more answers to this question that work here

3
  • 1
    Good call, but this specific solution gets blocked, because it is regarder as popup ...
    – lekroif
    Jan 17, 2013 at 2:47
  • If you are using jquery, you could try making links with target='_blank' then triggering a click event on them. That might let you circumvent the popup blocker.
    – Ethan
    Jan 17, 2013 at 2:50
  • I changed the target from '' to '_blank', but that still get's blocked by the popup blocker. Only IE allows it.
    – lekroif
    Jan 17, 2013 at 2:51
1

Try this example. I hope this something like this is what you want. About popup blocked you have to configure your browser to allow popup opened from this page. The easiest that I know to bypass the popup blocker is put this page inside local server like apache and set your browser to allow popup from localhost.

<html>
<script>
function openLinks(){
links = document.getElementsByTagName('a');

 for (i = 0; i < links.length;i++){ 
   window.open(links[i].getAttribute('href'),'_blank');
   window.focus();
 }
}
</script>

<body onload="openLinks()">

<a href="http://google.com">google</a>
<a href="http://stackoverflow.com">stackoverflow</a>
<a href="http://facebook.com">facebook</a>
<!-- add other link -->

</body>
</html>
1
  • I have updated the description of the question. You have to assume you have default browser setting, because as I said I am using multiple computers.
    – lekroif
    Jan 17, 2013 at 3:12
0

This functionality is built into Chrome. If you don't have to use an HTML file, try just setting your Startup Pages in Chrome's settings. You can add as many pages as you want.

http://support.google.com/chrome/bin/answer.py?hl=en&answer=95421

enter image description here

1
  • Good, but that means reconfiguring chrome. I am using different machines, which use default settings.
    – lekroif
    Jan 17, 2013 at 2:58
-1

You could just add window.open(adress) for every page you want to open, or you could use a for loop if you want to open 1 page a specific number of times.

1
  • 1
    Dude, that is already suggested by Ethan, it trigures the popup blocker.
    – lekroif
    Jan 17, 2013 at 2:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.