iMacros hanging bug

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
qnguye
Posts: 10
Joined: Tue Feb 02, 2021 1:10 am

iMacros hanging bug

Post by qnguye » Wed Mar 03, 2021 2:00 am

Firefox 86, windows 10, imacros for firefox addon version 10.0.2.1450
When i run this code below, firefox should ignore the failed tag and go to Gmail but it's not. Instead, imacros popup error and stopped

Code: Select all

SET !ERRORIGNORE YES
URL GOTO=http://badwebsiteexample.com/
WAIT SECONDS=2
TAG POS=1 TYPE=* ATTR=* EXTRACT=TXT
WAIT SECONDS=2
URL GOTO=https://gmail.com/
Popup error
RuntimeError: Navigation error occurred while loading url http://badwebsiteexample.com/, details: Error code 2152398878, line: 3
Tom, Tech Support
Posts: 3678
Joined: Mon May 31, 2010 4:59 pm

Re: iMacros hanging bug

Post by Tom, Tech Support » Fri Mar 05, 2021 12:25 pm

Hi Quy,

Thanks for reporting this. At first I thought the issue was that iMacros for Firefox was not ignoring navigation errors, but that turns out to not be the case. The problem is actually with the line that is attempting to do an extraction. You can see that the navigation error is successfully ignored and the macro runs to completion when commenting out the TAG command:

Code: Select all

SET !ERRORIGNORE YES
URL GOTO=http://badwebsiteexample.com/
WAIT SECONDS=2
' TAG POS=1 TYPE=* ATTR=* EXTRACT=TXT
WAIT SECONDS=2
URL GOTO=https://gmail.com/
So the problem is that the attempt to tag -or- extract an element on one of these special 'interstitial' pages (e.g. Server Not Found; This site can't be reached) is causing iMacros to hang. I have logged this issue for further investigation.
Regards,

Tom, iMacros Support
chivracq
Posts: 9713
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iMacros hanging bug

Post by chivracq » Fri Mar 05, 2021 12:49 pm

Tom, Tech Support wrote:
Fri Mar 05, 2021 12:25 pm
Hi Quy,

Thanks for reporting this. At first I thought the issue was that iMacros for Firefox was not ignoring navigation errors, but that turns out to not be the case. The problem is actually with the line that is attempting to do an extraction. You can see that the navigation error is successfully ignored and the macro runs to completion when commenting out the TAG command:

Code: Select all

SET !ERRORIGNORE YES
URL GOTO=http://badwebsiteexample.com/
WAIT SECONDS=2
' TAG POS=1 TYPE=* ATTR=* EXTRACT=TXT
WAIT SECONDS=2
URL GOTO=https://gmail.com/
So the problem is that the attempt to tag -or- extract an element on one of these special 'interstitial' pages (e.g. Server Not Found; This site can't be reached) is causing iMacros to hang. I have logged this issue for further investigation.

Yep, and you also get the exact same Behaviour with any 'EVAL()' while being on such a "Page" that I had reported here and here during the Beta-Testing Phase for v10.0.2 for FF and qualified as Blocking but that was "a bit ignored" and FF v10.0.2 still got released... :(
(... And that I have re-re-reported/mentioned again several times in different Threads since...)

But 'EVAL()' is most of the time combined with 'EXTRACT', at least in "my" Scripts, so it could actually even be that both Issues are just one and a same Issue... :idea:
- (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...
Tom, Tech Support
Posts: 3678
Joined: Mon May 31, 2010 4:59 pm

Re: iMacros hanging bug

Post by Tom, Tech Support » Fri Mar 05, 2021 1:04 pm

chivracq wrote:
Fri Mar 05, 2021 12:49 pm
But 'EVAL()' is most of the time combined with 'EXTRACT', at least in "my" Scripts, so it could actually even be that both Issues are just one and a same Issue... :idea:
That is more likely the case, because simply calling EVAL on one of these pages does not produce the behavior:

Code: Select all

SET !ERRORIGNORE YES
URL GOTO=http://badwebsiteexample.com/
WAIT SECONDS=2
' TAG POS=1 TYPE=* ATTR=* EXTRACT=TXT
SET test EVAL("var test = 'This is a test'; test;")
PROMPT {{test}}
WAIT SECONDS=2
URL GOTO=https://gmail.com/
Regards,

Tom, iMacros Support
chivracq
Posts: 9713
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iMacros hanging bug

Post by chivracq » Fri Mar 05, 2021 1:28 pm

Tom, Tech Support wrote:
Fri Mar 05, 2021 1:04 pm
chivracq wrote:
Fri Mar 05, 2021 12:49 pm
But 'EVAL()' is most of the time combined with 'EXTRACT', at least in "my" Scripts, so it could actually even be that both Issues are just one and a same Issue... :idea:
That is more likely the case, because simply calling EVAL on one of these pages does not produce the behavior:

Code: Select all

SET !ERRORIGNORE YES
URL GOTO=http://badwebsiteexample.com/
WAIT SECONDS=2
' TAG POS=1 TYPE=* ATTR=* EXTRACT=TXT
SET test EVAL("var test = 'This is a test'; test;")
PROMPT {{test}}
WAIT SECONDS=2
URL GOTO=https://gmail.com/

Alright..., then hum..., this is "nearly" a "good News" then, ah-ah...! :P

Then, hum..., the Workaround I had (in mind) for 'EVAL()' already would also work for 'EXTRACT' then, and that's even "easier" if 'EVAL()' still works "everywhere", ah-ah...! :twisted:

It's "a bit cumbersome" but quite "ingenious" I would think (well, like always, ah-ah...! :P ), I'll post/explain it if @OP (or anybody) is "interested"... :|
- (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...
chivracq
Posts: 9713
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iMacros hanging bug

Post by chivracq » Fri Mar 05, 2021 5:55 pm

qnguye wrote:
Fri Mar 05, 2021 5:44 pm
it's a nice workaround. thanks :)

Euh...!?, the only "(kind of) Workaround" posted until now in this Thread, was by @Tom commenting out the "incriminating" Line with the 'EXTRACT' to troubleshoot that the 'EXTRACT' is the Command causing the Script to hang... But I wouldn't really call that a "nice Workaround", ah-ah...! :?
- (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...
qnguye
Posts: 10
Joined: Tue Feb 02, 2021 1:10 am

Re: iMacros hanging bug

Post by qnguye » Sat Mar 06, 2021 12:02 am

chivracq wrote:
Fri Mar 05, 2021 1:28 pm
Tom, Tech Support wrote:
Fri Mar 05, 2021 1:04 pm
chivracq wrote:
Fri Mar 05, 2021 12:49 pm
But 'EVAL()' is most of the time combined with 'EXTRACT', at least in "my" Scripts, so it could actually even be that both Issues are just one and a same Issue... :idea:
That is more likely the case, because simply calling EVAL on one of these pages does not produce the behavior:

Code: Select all

SET !ERRORIGNORE YES
URL GOTO=http://badwebsiteexample.com/
WAIT SECONDS=2
' TAG POS=1 TYPE=* ATTR=* EXTRACT=TXT
SET test EVAL("var test = 'This is a test'; test;")
PROMPT {{test}}
WAIT SECONDS=2
URL GOTO=https://gmail.com/
I ran it and it still hang :( Error message "


Alright..., then hum..., this is "nearly" a "good News" then, ah-ah...! :P

Then, hum..., the Workaround I had (in mind) for 'EVAL()' already would also work for 'EXTRACT' then, and that's even "easier" if 'EVAL()' still works "everywhere", ah-ah...! :twisted:

It's "a bit cumbersome" but quite "ingenious" I would think (well, like always, ah-ah...! :P ), I'll post/explain it if @OP (or anybody) is "interested"... :|
I ran that and it still hang. Worst! Error message "MacroError: Missing host permission for the tab, line: 5". My firefox is frozen after this.
chivracq
Posts: 9713
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iMacros hanging bug

Post by chivracq » Sat Mar 06, 2021 1:35 am

qnguye wrote:
Sat Mar 06, 2021 12:02 am
I ran that and it still hang. Worst! Error message "MacroError: Missing host permission for the tab, line: 5". My firefox is frozen after this.

Hum..., that's indeed the "kind" of Runtime Error I remember (from 2.5 years ago) when I had done some Testing for the Beta Version..., and related to 'EVAL()' and my "Blocking Bug"... :( :twisted:

OK, I'll try to do a bit of Testing "tomorrow" myself, but I need to "plan" that, because FF is a bit of a pain in the ass with running several Versions at the same time as I also use FF55 a bit regularly during the day... :|
- (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...
Tom, Tech Support
Posts: 3678
Joined: Mon May 31, 2010 4:59 pm

Re: iMacros hanging bug

Post by Tom, Tech Support » Wed Mar 10, 2021 9:04 am

chivracq wrote:
Sat Mar 06, 2021 1:35 am
OK, I'll try to do a bit of Testing "tomorrow" myself, but I need to "plan" that, because FF is a bit of a pain in the ass with running several Versions at the same time as I also use FF55 a bit regularly during the day... :|
And therein lies the power of virtualization my friend! You should consider using something like VirtualBox (free) to create one or more virtual machines where you can easily test different environments / scenarios. Of course, this also means you need extra licenses for whatever OS you install in your VM.
Regards,

Tom, iMacros Support
Tom, Tech Support
Posts: 3678
Joined: Mon May 31, 2010 4:59 pm

Re: iMacros hanging bug

Post by Tom, Tech Support » Wed Mar 10, 2021 9:18 am

qnguye wrote:
Sat Mar 06, 2021 12:02 am
I ran that and it still hang. Worst! Error message "MacroError: Missing host permission for the tab, line: 5". My firefox is frozen after this.
It's funny that I did not see this error the other day when I was testing. But I just retested my sample macro again now and can reproduce the same behavior. I'm pretty sure the "Missing host permission" error occurs because the EVAL command can only be executed against an actual web page (not one of the internal, interstitial pages). However, I agree that the error should be ignorable via the SET !ERRORIGNORE YES command so I've logged this as well.
Regards,

Tom, iMacros Support
qnguye
Posts: 10
Joined: Tue Feb 02, 2021 1:10 am

Re: iMacros hanging bug

Post by qnguye » Thu Mar 11, 2021 11:42 pm

I found a workaround after many days :D I put it here if anyone interested.
So, when FF hanging, if you click "Try Again" or Refresh the page, imacros will continue. Since, imacros is waiting for firefox send back the complete signal but never get it because firefox hang.
I made the firefox error page to refresh every 30 seconds then imacros continue. To do that, I modified the omni.ja in

Code: Select all

C:\Program Files\Mozilla Firefox\browser
Open that omni.ja with a zip app,

Code: Select all

chrome\browser\content\browser\aboutNetError.xhtml,
add meta tag to refresh every 30 seconds

Code: Select all

<meta http-equiv="refresh" content="30" />
Tom, Tech Support
Posts: 3678
Joined: Mon May 31, 2010 4:59 pm

Re: iMacros hanging bug

Post by Tom, Tech Support » Fri Mar 12, 2021 8:58 am

qnguye wrote:
Thu Mar 11, 2021 11:42 pm
I found a workaround after many days :D I put it here if anyone interested.
So, when FF hanging, if you click "Try Again" or Refresh the page, imacros will continue. Since, imacros is waiting for firefox send back the complete signal but never get it because firefox hang.
I made the firefox error page to refresh every 30 seconds then imacros continue. To do that, I modified the omni.ja in

Code: Select all

C:\Program Files\Mozilla Firefox\browser
Open that omni.ja with a zip app,

Code: Select all

chrome\browser\content\browser\aboutNetError.xhtml,
add meta tag to refresh every 30 seconds

Code: Select all

<meta http-equiv="refresh" content="30" />
Very clever workaround! Thank you for posting your solution here!
Regards,

Tom, iMacros Support
Post Reply