is there any batch code to detect a time when one tab finish it load in firefox browser?
i had a batch code to run (50 tabs) with (15 seconds interval of sleep/wait) (per tab)
and i observed that not all 50 tabs are within 10-15 seconds to finish load of webpage. (actually my network-speed to complete load is averaging 15 seconds ) .
some other tabs can finish load from 5-8 seconds and
i need batch code to run next tab than waiting for timeout to finish 15-seconds before next run.
at this time when running code below -- i just manually press enter to bypass timeout if some tab finish it load earlier than 15-seconds wait-interval.
here is my code:
Code: Select all
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
:: after grabbing all links from one webpage (it is easy to grabbed all link and sort in batch file than manually remove blankline, unwanted link.etc)
:: then copy and paste its links to input.txt
:: i had already find code to match link i needed,
echo removing unneeded links,
echo deleting first batch of unmatched lines....
echo.
cmd /c FindRepl.bat "http://(\w+).(\w+).(\w+)(/\w+)(/\w+).\w+\?\w=\d&\w+=\d+&p=\w+#\w+" "" < input.txt > first_batch.txt
ping -n 5 localhost >nul
echo deleting last batch of unmatched lines .....
echo.
cmd /c FindRepl.bat "http://(\w+).(\w+).(\w+)(/\w+)(/\w+).\w+\?\w=\d&\w+=\d+&\w+=\w+" "" < first_batch.txt > last_batch.txt
ping -n 5 localhost >nul
echo start extracting matched line....
echo.
:: start extracting matched line only
cmd /c FindRepl "http://(\w+).(\w+).(\w+)(/\w+)(/\w+).\w+\?\w=\d&\w=\d+\b" /$:0 /Q: < last_batch.txt >selected.txt
ping -n 5 localhost >nul
echo running all links listed in selected.txt:
echo.
set "count=0"
for /f %%a in (selected.txt) do (
set "m=%%a"
start "" firefox.exe -new-tab "!m!"
set /a "count+=1"
echo [!count!] = !m!
timeout 15
)
echo multi-tabs processing completed
echo manually start saving now by using UnMHT addons.
timeout 10
exit
hoping some answer my problem, so that i cant wait every tab load to manually press.
i really need automatic batch-script to load next run rather than waiting for timeout to expired.
but using a 5 seconds interval will result to 3-5 tabs still running at the same time and interfere each other connection which result of some are completed and other are failed (it required manual re-connection to finished load).
while 15-seconds interval had no conflicting connection because its one tab running and completed before 15-seconds expired.
any helps greatly appreciated.
bars