open link in new tab javascript?

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
lumer8
Posts: 17
Joined: Tue Sep 02, 2014 3:15 am

open link in new tab javascript?

Post by lumer8 » Sat Nov 15, 2014 11:34 pm

I tried the following code but it clicks on the link before opening a new tab.
The code is the same way you would do it in imacros so not sure whats going on?

Code: Select all

var newTab;
    newTab = "CODE:";
    newTab += "TAG POS={{ITEM}} TYPE=A ATTR=HREF:http://google.com/*" + "\n";
    newTab += "TAB OPEN NEW" + "\n";
    newTab += "TAB T=2" + "\n";

Imacros 8.8.5
Firefox 32
Windows 8
additional001
Posts: 175
Joined: Sun Jul 06, 2008 3:24 am

Re: open link in new tab javascript?

Post by additional001 » Wed Nov 19, 2014 5:16 am

Try...

Code: Select all

var newTab;
    newTab = "CODE:";
    newTab += "TAB OPEN NEW" + "\n";
    newTab += "TAB T=2" + "\n";
    newTab += "TAG POS={{ITEM}} TYPE=A ATTR=HREF:http://google.com/*" + "\n";
Post Reply