Accessing page javascript variables directly

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
Puss
Posts: 18
Joined: Fri May 08, 2009 2:32 pm

Accessing page javascript variables directly

Post by Puss » Mon May 11, 2009 4:57 pm

Is there a way of accessing webpage javascript *variables* (not page elements or the contents of text boxes etc) directly from a .js iMacro ?

How can these 'in page js' values be extracted without creating new elements in the page to 'expose' them to iMacros?

Anyone got any ideas?

I tried cookies, http://forum.iopus.com/viewtopic.php?f= ... 485#p20485, but that didn't seem to work.
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: Accessing page javascript variables directly

Post by Tech Support » Wed May 27, 2009 11:05 pm

This is currently not supported. A workaround would be to combine iMacros with Greasemonkey.

1. Use Greasemonkey to insert Javascript code to print the values on the page
2. Then use the normal iMacros text extraction

Can I ask why you need to extract these values? What is the use case?
Puss
Posts: 18
Joined: Fri May 08, 2009 2:32 pm

Re: Accessing page javascript variables directly

Post by Puss » Thu May 28, 2009 12:27 pm

Thanks for the suggestion. That's the only way I have found to make it work, but it's a bit clunky.

I thought I had sussed it when trying cookies, but that didn't work.

Use case: Basically data extraction / synchronisation, but I wanted to avoid altering the DOM of the page, so direct access to the variables would have been nice.
Post Reply