Help with GOTO=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
zak.xpd
Posts: 3
Joined: Wed Mar 08, 2017 3:35 pm

Help with GOTO=javascript

Post by zak.xpd » Sun Mar 12, 2017 1:28 pm

Hello guys, I have the following problem:

I am using the latest version of iMacros for Firefox (V9.0.3) on Firefox(51.0.1 (32-bit)). When I try to execute a macro with ANY js like this:

Code: Select all

VERSION BUILD=10022823
URL GOTO=javascript:window.scrollTo(0,0)
The code is executed, but the plugin waits 60 seconds for page to load (there is no page, just js) and I get:
Page loading timeout, URL: javascript:window.scrollTo(0,0), line: 2 (Error code: -802)
I am executing the macro with iimPlay() from a js macro.

Thank you for the help in advance!
chivracq
Posts: 9319
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Help with GOTO=javascript

Post by chivracq » Sun Mar 12, 2017 5:37 pm

zak.xpd wrote:Hello guys, I have the following problem:

I am using the latest version of

Code: Select all

iMacros for Firefox (V9.0.3) on Firefox(51.0.1 (32-bit)).
When I try to execute a macro with ANY js like this:

Code: Select all

VERSION BUILD=10022823
URL GOTO=javascript:window.scrollTo(0,0)
The code is executed, but the plugin waits 60 seconds for page to load (there is no page, just js) and I get:
Page loading timeout, URL: javascript:window.scrollTo(0,0), line: 2 (Error code: -802)
I am executing the macro with iimPlay() from a js macro.

Thank you for the help in advance!
I first thought, grrr..., a Duplicate...!, but no, perfect actually, your Original Post was only kind of "polluting" the "FF Bugs and EnhReqs Thread", or maybe not the OP but all Replies that follow up then..., so this current Standalone Thread is perfect, and I've linked to it in my Reply... (hum, and removed the "use your brain" part which was unnecessarily a bit nasty, your OP was completely Legit, oops...!)

Quoting as well @sightunseen's Reply from the first Thread:
sightunseen wrote:
zak.xpd wrote:

Code: Select all

VERSION BUILD=10022823
URL GOTO=window.scrollTo(0,0)
The code is executed, but iMacros waits 60 seconds for page to load (there is no page, just js) and I get:
Page loading timeout, URL: window.scrollTo(0,0), line: 2 (Error code: -802)
I think you mean

Code: Select all

URL GOTO=javascript:window.scrollTo(0,0)
I have the same problem in the latest Firefox and latest iMacros (9.0.3). I have also tried 8.9.7 and same problem, even if I disable Firefox's multi-process mode. It does work but like you said it then waits. If you look at iMacros' version history you can see that javascript:... is no longer supported. That is a real problem, it's breaking stuff. Putting it in a js file gives
Error: Accessing content window is not supported in multiprocess Firefox, line 208 (Error code: -991)

I'm using 8.9.7 elsewhere to access the page DOM via js macros, see a separate thread I made about that at http://forum.imacros.net/viewtopic.php?f=11&t=27304

In other words if you downgrade to 8.9.7 and disable multi-process then you can put in your js script window.scrollTo(0,0); or scrollBy, one of those should work.

Hopefully this will be fixed for multi-process and javascript: can return.
Well, at OP, @sightunseen gave you the Solution, or at least the only Solution/Workaround at this moment, it is to downgrade from v9.0.3 for FF to v8.9.7 for FF.
I tested it again just now on v8.9.7 for FF + FF v51.0.1 + Win10-x64 from a Standalone '.iim' Macro and it works perfectly, which I knew already as I use this Functionality a lot myself in several of my ('.iim') Macros.

And v8.9.7 should still work on FF52 as well, was confirmed by TechSup 2 or 3 days ago, I am still on FF51 so I cannot test for this specific Command but I don't expect any Change...
- (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...
zak.xpd
Posts: 3
Joined: Wed Mar 08, 2017 3:35 pm

Re: Help with GOTO=javascript

Post by zak.xpd » Sun Mar 12, 2017 7:37 pm

Thank you very much for the quick reply and sorry for the precious post. I should't have posted so late and so tired :)

Downgrading works fine for me, but still would love to see this in some of the next versions, though they say it is deprecated.
chivracq
Posts: 9319
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Help with GOTO=javascript

Post by chivracq » Sun Mar 12, 2017 8:02 pm

zak.xpd wrote:Thank you very much for the quick reply and sorry for the precious post. I should't have posted so late and so tired :)

Downgrading works fine for me, but still would love to see this in some of the next versions, though they say it is deprecated.
OK, good to hear indeed about v8.9.7...

Yep about "deprecated", you could post as well in @sightunseen's Thread he referred to, the more Users "complain" about this Functionality not being supported anymore, the more Chance we make to hopefully see it supported again in later Versions...
- (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...
MasterDebugger
Posts: 2
Joined: Mon Mar 13, 2017 5:12 pm

Re: Help with GOTO=javascript

Post by MasterDebugger » Mon Mar 13, 2017 7:52 pm

Have you tried something like this:


VERSION BUILD=10022823
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 2
WAIT SECONDS=1
URL GOTO=javascript:window.scrollTo(0,0)
SET !ERRORIGNORE NO
SET !TIMEOUT_STEP 10
chivracq
Posts: 9319
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Help with GOTO=javascript

Post by chivracq » Mon Mar 13, 2017 9:51 pm

MasterDebugger wrote:Have you tried something like this:

Code: Select all

VERSION BUILD=10022823
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 2
WAIT SECONDS=1
URL GOTO=javascript:window.scrollTo(0,0)
SET !ERRORIGNORE NO
SET !TIMEOUT_STEP 10
Euh..., yep indeed, I had thought of stg similar at the time of the Original Post in the other Thread, about the 60 sec Delay, but I think it will rather be '!TIMEOUT_PAGE' (and not '!TIMEOUT_STEP') that could help to shorten the 60 sec to Max 1 sec with stg like:

Code: Select all

SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 1
URL GOTO=javascript:window.scrollTo(0,0)
SET !TIMEOUT_PAGE 60
I suspect that because 'URL GOTO=javascript' has more or less been dropped in v9.0.3, that 'URL GOTO' now always expects to load a "real" Web-Page and expects some 'Page_Loading_Complete' Sign which it now never gets, before eventually processing further Statements in the Macro...
- (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...
Post Reply