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.

lekroif
  • 992
  • 3
  • 12
  • 24

5 Answers5

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

Community
  • 1
  • 1
matthewpavkov
  • 2,918
  • 4
  • 21
  • 37
  • 2
    Good Job! I didn't know that functionality of batch scripts. – lekroif Jan 17 '13 at 03: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 '16 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

Community
  • 1
  • 1
Ethan
  • 2,754
  • 1
  • 21
  • 34
  • Good call, but this specific solution gets blocked, because it is regarder as popup ... – lekroif Jan 17 '13 at 02: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 '13 at 02: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 '13 at 02: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>
Jon Kartago Lamida
  • 827
  • 1
  • 7
  • 12
  • 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 '13 at 03: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

matthewpavkov
  • 2,918
  • 4
  • 21
  • 37
  • Good, but that means reconfiguring chrome. I am using different machines, which use default settings. – lekroif Jan 17 '13 at 02: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.

user1631686
  • 19
  • 1
  • 1
  • 4