• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

Can I Ungroup a spawned Tab?

I am creating a personal home page that has buttons that spawn a series of new tabs within by browser.  However, my home page becomes a part of the group of pages that I spawn.  So, I then need to right click my home page tab and select ungroup this tab.  

I'd like the home page to spawn the new tabs as a group, and then ungroup itself from the newly spawned group of pages using HTML or some other method.  How would I do this?  

Sample code is provided...

Thanks...RG
<br><a href="http://www.comics.com/" target="_blank"
        onclick="window.open(&quot;http://www.dilbert.com/&quot;);">
        Comic Pages</a>

Open in new window

0
RGRodgers
Asked:
RGRodgers
  • 5
  • 5
1 Solution
 
mrwad99Commented:
I suggest something like this code.  It will spawn three new pages, then attempt to close the parent window.  However, IE will prompt the user to close the parent page: I don't think you can get around that.

<HTML>
<script>
function test()
{
	window.open ( "http://www.google.com" );
	window.open ( "http://www.yahoo.com" );
	window.open ( "http://www.thomsonreuters.com" );
	window.close();
}
</script>
<body>
<input type = "button" onClick ="test()" Value = "ClickMe">
</body>
</html>

Open in new window


Is this the kind of thing you are after?

HTH
0
 
RGRodgersAuthor Commented:
Thanks for the input.  I really don't want to close the parent page, just ungroup it.  Is that at all possible?  Thanks...RG
0
 
mrwad99Commented:
There is not going to be any standard way of doing that.  This is simply because you cannot be sure that the user has a browser that supports tabs: I admit, the majority of users are going to be, but you can turn it off in some browsers - what would you do in that circumstance?

I take it that when you say "undock", you mean "open page in a separate main frame window, where there is only one 'tab' in that window".

Am I right?  If so, you might be able to change your thinking:  instead of having the tabs

<home page>, <tab 1>, <tab 2>, <tab 3>

after the click, then trying to "move" <home page> to a new window,

how about you replace <home page> with <tab 1>, then force a new window to open displaying home page, i.e.

<tab 1, replacing home page>, <tab 2>, <tab 3>

Then the code becomes something like this:

function test()
{
        var currentPage = location.href; // Store current "home" page
	location.href =  "http://www.google.com"; // Replace current page
	window.open ( "http://www.yahoo.com" );
	window.open ( "http://www.thomsonreuters.com" );
	
        // Now we just need to force the current page, stored in "currentPage",
        // to open in a new window, not a new tab.  However, this is not easy, since
        // the user may have, in IE for example, specified "open new windows in new tabs" or similar setting...

}

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
mrwad99Commented:
If I misunderstand your notion of "ungroup", then please clarify, including some screenshots if I have badly misinterpreted it ;)
0
 
RGRodgersAuthor Commented:
mrwad99 -- I think you are going in the right direction.  I'll look it over tonight and see what I can do.  Since it is just my personal home page, I am less concerned about environments other than my own, but your input is interesting and I will consider it.  I'll let you know what I find.  Thanks again...RG
0
 
RGRodgersAuthor Commented:
mrwad99 -- I guess not.  This appears to open another window with the new group of tabs.  I want the tabs opened in the same window when I click the home page button.  I just want the home page to not be part of the tab group so that when I click another button, I generate a new tab group.  One button may be my home pages, another may be news, and another may be tools.  I want each of those all in the same window but under different groups.  Right now, I do it manually.  When I click any of the buttons, I then right click the home page and select Ungroup This Tab.  That way, if I click another button, it is a whole new tab group.  Thanks...RG
0
 
mrwad99Commented:
I am not following you.  Can you paste some screenshots of what you are currently seeing versus what you want to see, please?
0
 
RGRodgersAuthor Commented:
They are attached.  Let me know if you have questions.  Thanks...RG
ScreenShots.docx
0
 
mrwad99Commented:
OK.  I have downloaded IE8 just for you :o) to try and figure this out: I can see a way to do it, but not the exact way you want.

The problem lies in how IE8 determines which "group" to put tabs in.  Visually, a group is merely a colour; different groups are determined by different colours, as you know.  But the thing is, any link clicked off page 'X' is going to be in the same group as page 'X'.  There is no getting around that.  Subsequently, any link opened in a new tab off of a link opened off page 'X' is going to be in the same group as page 'X'.  This is the problem.  There is no way to get around that.

You hence need to spoof IE so that it does not know where the links were opened from, which will force it into opening them all in new groups.  Going back to my example above, where I opened three links: except that I no longer close the current page - I instead "overwrite" it with Google.com -

<HTML>
<script>
function DoLoad()
{
	location.href = "http://www.google.com";
	window.open ( "http://www.yahoo.com" );
	window.open ( "http://thomsonreuters.com" );
}
</script>
<body onload = "DoLoad()">
</body>
</HTML>

Open in new window


If you save this as a HTML file in

C:\Documents and Settings\<YOUR USER NAME>\Favorites\Links (note that this might appear as "Favourites Bar")

(I called it "FirstGroup.html"), you will see it appears on the favourites bar.  Alternatively, you can just save it to

C:\Documents and Settings\<YOUR USER NAME>\Favorites\

if you dont want it on the bar, just in the Favourites menu.  Now, you can middle click the icon on the bar and it will open all three URLs as shown below.  

    First group
(Note: middle clicking will default to opening a new tab, thereby not overwriting whatever is on the currently active tab when you click: of course if you want to replace the current tab click normally).  Then if you create/save in the same place a second page, say with the following content:

<HTML>
<script>
function DoLoad()
{
	location.href = "http://www.microsoft.com";
	window.open ( "http://www.cnn.com" );
	window.open ( "http://bbc.co.uk" );
}
</script>
<body onload = "DoLoad()">
</body>
</HTML>

Open in new window


you can then middle click this link and it will open these three tabs in a different group, as shown below.

 Second group
If you like this idea, you need to create one HTML page for each "group", and add the appropriate URLs in.

I know this is not exactly what you want, but as mentioned above, you are not going to get that because of how IE determines whether or not a page should go in a 'new' group or not.  Since clicking a link on the favourites bar yields no "source" page, IE has no choice but to create a new group.

Hope this helps.
0
 
RGRodgersAuthor Commented:
I do believe that this is the best possible solution even if it isn't exactly what I wanted.  As a matter of fact, the prior solution presents a viable option too.  Thanks...RG
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now