Can you open url in new tab without changing focus?

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
jsherk
Posts: 7
Joined: Tue Nov 16, 2010 6:30 pm

Can you open url in new tab without changing focus?

Post by jsherk » Wed Nov 17, 2010 6:05 pm

I searched the docs and the forum and still cannot figure out how to do this...

I want to open a url in a new tab (Firefox), but I do not want to wait for the url to load and I do not want the focus to change to the new tab.

I have this code:

Code: Select all

TAB T=1
TAB OPEN
TAB T=2
URL GOTO=http://mydomain.com
TAB T=1
The problem is that it changes the focus to the new tab and then waits for the page to load before it returns the tab 1 and continues the macro. I need to stay on tab 1 and continue the macro while the url page is loading in the other tab.

Is there a way do this?

Thanks
jbwocky
Posts: 24
Joined: Fri Aug 28, 2009 7:36 am

Re: Can you open url in new tab without changing focus?

Post by jbwocky » Wed Nov 17, 2010 6:16 pm

Hi,

I don't believe there is a way to do what you want. The closest you can get to that is by lowering the timeout (the time the macro waits for the page to load) to the lowest possible value for the page you want to load in the second tab, and setting errorignore to yes, so that it doesn't crash the macro, like this:

Code: Select all

TAB T=1
SET !ERRORIGNORE YES
SET !TIMEOUT 1
TAB OPEN
TAB T=2
URL GOTO=http://www.amazon.com
SET !ERRORIGNORE NO
SET !TIMEOUT 60
TAB T=1
URL GOTO=http://www.google.com
jsherk
Posts: 7
Joined: Tue Nov 16, 2010 6:30 pm

Re: Can you open url in new tab without changing focus?

Post by jsherk » Wed Nov 17, 2010 6:18 pm

I actually tried that as well, but the problem is that if the page in the new tab does not load completely in that 1 second interval then it aborts the rest of the page load as opposed to continuing!

I wonder if it can be done from JavaScript? I will look into it..

Thanks
Tom, Tech Support
Posts: 3675
Joined: Mon May 31, 2010 4:59 pm

Re: Can you open url in new tab without changing focus?

Post by Tom, Tech Support » Sat Nov 27, 2010 10:52 am

See my response on this post:

http://forum.imacros.net/viewtopic.php?f= ... 778#p34778
I wonder if it can be done from JavaScript? I will look into it.
Good idea, don't forget to share your results!
Regards,

Tom, iMacros Support
Post Reply