Open New Tab in Foreground (Link)

5
1 vote
Your rating: None

This simply combines "New Tab" and "Open Link In New Foreground Tab" so a new tab is created in the foreground that opens to a link, if one was selected, or just simply a new tab if no link was used (default "new tab" behavior).

Runs in:

the target frame

Script:

var link = MS.initevt.target.href;

if(link)
{
    MS.apis.tabs.create({
	url: link,
        selected: true
    });
}
else
{
    MS.apis.tabs.create({
        selected: true
    });
}

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <strike> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is to prevent automated spam submissions, you will not see this again after registration.