Load new tab without waiting for current to finish

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
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
johnsteen
Posts: 2
Joined: Sun Feb 08, 2009 6:14 pm

Load new tab without waiting for current to finish

Post by johnsteen » Sun Feb 08, 2009 6:24 pm

Hi,

I would like to open and load a URL in a new tab without waiting for the current tab's URL to finish loading. This is something I would want to use in other macros however I have not been able to find the answer in the help or forums.
The code I have so far is below, if anyone could help with how to tell tab1 to load gmail then open and load tab2 (bbc business news) without waiting for gmail to finish loading.

VERSION BUILD=6111228 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=http://192.168.2.1/
FRAME F=4
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:tF0 ATTR=NAME:con1&&VALUE:Connect
SET !TIMEOUT 2
SET !ERRORIGNORE YES
URL GOTO=https://gmail.google.com/
SET !TIMEOUT 60
SET !ERRORIGNORE NO
TAB OPEN
TAB T=2
URL GOTO=http://news.bbc.co.uk/1/hi/business/default.stm

Regards,
John.
Rik
Posts: 4
Joined: Wed Oct 01, 2014 8:33 am
Location: UK
Contact:

Re: Load new tab without waiting for current to finish

Post by Rik » Wed Oct 01, 2014 10:09 am

Is this question still without answer? I have the same problem today.

I have to open 3 URLs, lets say A, B, C (external websites).
All the three are pages that automatically (via js) open a new website, so if I open A it automatically opens/closes A1 in a bunch of seconds, B opens.closes B1, etc.
(Basically A/B/C are crawlers and A1/B1/C1 are random pages they crawl.)

SOLUTION 1 (impossible)
To succed in opening the three in separate tabs I should be able to open them all at once, in parallel or at least very fast.This would be the easy solution, but this is impossibile because iMacro waits for each page to finish loading.
I've tried with !TIMEOUT_PAGE but doesn't help at all. (I notice now there is also timeout for step... I'll try it next)

SOLUTION 2 (1/2 working)
The other solution could be the contrary: setting a WAIT for each URL such as
URL GOTO=A
WAIT SECONDS=10

to be sure that subsequent...
TAB OPEN
TAB T=3
URL GOTO=B

... opens for sure in TAB 3 and not in 2.
But I can't predict which is the last tab because could happen that TAB 2 has already been opened and closed or never opened for some errors in website A (not unlikely and that why I'm using iMacros to start everything from scratch every 15 minutes).

Moreover iMacros also wait for A1 to load despite is a "subproduct" of A of which shouldn't be aware of... so my 10 seconds of WAIT becomes anythings, from 10s to 2 minutes.

In other words, this is the timeline of what happens:

URL GOTO=A (Here happens that website A loads and opens A1 via JS)
WAIT SECONDS=10 (Actually this 10s are not reliable: they depends on A1 loading time)
TAB OPEN (I cannot predict if A1 has really been opened or is still there)
TAB T=2 (Could be wrong. If A opened A1 it replaces it and them B will be closed by A)
URL GOTO=B
TAB OPEN
TAB T=3 (you should be very, very lucky here!)
URL GOTO=C

I suppose iMacro can't help here unless:
1) There is a way to load a page with 0 wait
2) There is a URL GOTO parameter to open the URL automatically on a new tab

Hope I'm wrong!

Rik
Wiki computing: http://www.riksoft.it/wikiriks/
Mint RS edition: http://www.riksoft.it/gratis.php
johnsteen
Posts: 2
Joined: Sun Feb 08, 2009 6:14 pm

Re: Load new tab without waiting for current to finish

Post by johnsteen » Wed Oct 01, 2014 10:28 am

Sorry I don't have a code solution to my original post. Main reason I stopped using iMacros.
I had wanted to open half a dozen webpages and automate logins.

My preference:
Manual solution is to get Firefox to open home page of multiple webpages, separate them by | (pipe), and login manually. At least them they all start (initial) loading straight away.
:)
Rik
Posts: 4
Joined: Wed Oct 01, 2014 8:33 am
Location: UK
Contact:

Re: Load new tab without waiting for current to finish

Post by Rik » Wed Oct 01, 2014 2:16 pm

Thanks for the info.
I've changed approch to the problem using 3 different instances of Firefox and 3 different macros. This way they cannot damage each other.

I think a good choice for particular things could be Selenium IDE that I already use for similar stuff but I wouldn't use in this case because it's on a p3-500 with only 500MB RAM :oops: :D (Ubuntu Server + OpenBox = 42MB. + Tor Browser =~ 120MB. After 24 hours it is around 200MB.)

Selenium IDE I think has a bigger RAM consumption (not tested but I suppose the number of modules loaded counts!) so I chose to avoid it for this particular case. But if you have enough RAM quantity, consider the use of Selenium IDE because it allows very more strange things that iMacros, including shooting clicks with 0 waiting. I use it for automation even on flash pages.
Wiki computing: http://www.riksoft.it/wikiriks/
Mint RS edition: http://www.riksoft.it/gratis.php
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: Load new tab without waiting for current to finish

Post by skippyto » Wed Oct 01, 2014 2:18 pm

Hi Rik,

You are not so far, think using !ERRORIGNORE (http://wiki.imacros.net/ERRORIGNORE) and !TIMEOUT_PAGE (http://wiki.imacros.net/!TIMEOUT_PAGE) together instead of WAIT.

!TIMEOUT_PAGE must be a positive integer, but it nearly does the job :

Code: Select all

' --- OPTIONAL --- 
TAB CLOSEALLOTHERS
' --- MANDATORY ---
SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 1
URL GOTO=https://www.google.com
TAB OPEN
TAB T=2
URL GOTO=https://www.yahoo.com
TAB OPEN
TAB T=3
URL GOTO=https://www.amazon.com
' --- OPTIONAL ---
TAB T=1
' Add here login actions for the first URL
TAB T=2
' Add here login actions for the second URL
TAB T=3
' Add here login actions for the third URL
PROMPT "finished"
Skippyto.
chivracq
Posts: 8763
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Load new tab without waiting for current to finish

Post by chivracq » Wed Oct 01, 2014 11:13 pm

johnsteen wrote:Sorry I don't have a code solution to my original post. Main reason I stopped using iMacros.
I had wanted to open half a dozen webpages and automate logins.

My preference:
Manual solution is to get Firefox to open home page of multiple webpages, separate them by | (pipe), and login manually. At least them they all start (initial) loading straight away.
:)
Pity for you, but you should have bumped your Thread from time to time or have checked the Forum, because I've answered that Question a few times already (but I joined the Forum only in April 2013)... and my Solution is more or less like 'Skippyto''s except that in his Example the first Login will probably won't work unless you have a very quick Connection guarantying that the first Page will load in less than 3 sec when you get back to it..., you would then need to had some "Conditional WAIT", search my Posts with those Terms...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Rik
Posts: 4
Joined: Wed Oct 01, 2014 8:33 am
Location: UK
Contact:

Re: Load new tab without waiting for current to finish

Post by Rik » Thu Oct 02, 2014 11:17 am

@skippyto
That's 100% exactly the code I've used when I was talking about the "Solution 1", but it doesn't work because the website A opens A1 before the execution of URL GOTO=B.
I can't however count on the presence of those 2 tabs, opening B for sure on TAB 3, because A get stuck sometimes so B should be opened on TAB 2 and A1 gets TAB 3.
It's really unmanageable without proper commands, and iMacro doesn't have them yet.
Wiki computing: http://www.riksoft.it/wikiriks/
Mint RS edition: http://www.riksoft.it/gratis.php
chivracq
Posts: 8763
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Load new tab without waiting for current to finish

Post by chivracq » Thu Oct 02, 2014 12:59 pm

Rik wrote:@skippyto
That's 100% exactly the code I've used when I was talking about the "Solution 1", but it doesn't work because the website A opens A1 before the execution of URL GOTO=B.
I can't however count on the presence of those 2 tabs, opening B for sure on TAB 3, because A get stuck sometimes so B should be opened on TAB 2 and A1 gets TAB 3.
It's really unmanageable without proper commands, and iMacro doesn't have them yet.
Then you can use a Variable for "TAB T={{!VAR1}}" instead of switching blindly to 'TAB 2' or 'TAB 3', and you conditionally increment '!VAR1' based on '!URLCURRENT' (if <> "about:blank") with 'EVAL()' before doing your "URL GOTO=B"...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Rik
Posts: 4
Joined: Wed Oct 01, 2014 8:33 am
Location: UK
Contact:

Re: Load new tab without waiting for current to finish

Post by Rik » Thu Oct 02, 2014 3:51 pm

and you conditionally increment '!VAR1' based on '!URLCURRENT' (if <> "about:blank")
That works for sure in a code flow where A, B, C are GOTO URL, but will also work in my case where I only open A and A itself open A1 in a new tab (so B->B1 and C->C1)?

A1, B1, C1 are not in the code flow of the macro: where do I insert !URLCURRENT for testing the existence of A1?

I mean:
GOTO URL=A
#Here I can test !URLCURRENT for A but what about A1?
GOTO URL=B
#Here I can test !URLCURRENT for A but what about B1?
GOTO URL=C
Wiki computing: http://www.riksoft.it/wikiriks/
Mint RS edition: http://www.riksoft.it/gratis.php
Post Reply