User agent not resetting after running my macro

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
talon39
Posts: 1
Joined: Sun Aug 10, 2014 7:03 pm

User agent not resetting after running my macro

Post by talon39 » Sun Aug 10, 2014 7:25 pm

I wrote a simple macro that sets the user agent from a column in a CSV file.. The macro does what i want, except for one weird problem.. It seems to leave my firefox user agent changed after the macro has finished. How can I have the macro reset the user agent after it has finshed, so my browser goes back to it's default? From what I understand imacros for firefox will reset the user agent each time in is invoked.. But What I noticed was that it was resetting to the user agent to what it set on the first run of the macro, instead of back to the default user agent.

Example:

Code: Select all

VERSION BUILD=8530828 RECORDER=FX
SET !REPLAYSPEED FAST    
SET !EXTRACT_TEST_POPUP NO    
SET !DATASOURCE C:\Datasources\useragents.csv
PROMPT "UserLine" !VAR1 
SET !DATASOURCE_LINE {{!VAR1}}
SET !LOOP 1 
SET !DATASOURCE_COLUMNS 11
SET !USERAGENT {{!COL10}}   
TAB T=1
URL GOTO=http://www.whatsmyuseragent.com/
pause
chivracq
Posts: 8765
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: User agent not resetting after running my macro

Post by chivracq » Mon Aug 11, 2014 3:04 pm

talon39 wrote:I wrote a simple macro that sets the user agent from a column in a CSV file.. The macro does what i want, except for one weird problem.. It seems to leave my firefox user agent changed after the macro has finished. How can I have the macro reset the user agent after it has finshed, so my browser goes back to it's default? From what I understand imacros for firefox will reset the user agent each time in is invoked.. But What I noticed was that it was resetting to the user agent to what it set on the first run of the macro, instead of back to the default user agent.

Example:

Code: Select all

VERSION BUILD=8530828 RECORDER=FX
SET !REPLAYSPEED FAST    
SET !EXTRACT_TEST_POPUP NO    
SET !DATASOURCE C:\Datasources\useragents.csv
PROMPT "UserLine" !VAR1 
SET !DATASOURCE_LINE {{!VAR1}}
SET !LOOP 1 
SET !DATASOURCE_COLUMNS 11
SET !USERAGENT {{!COL10}}   
TAB T=1
URL GOTO=http://www.whatsmyuseragent.com/
pause
FCIM...! :mrgreen:

Are you still at v8.53? TechSupport will ask you to update first to the latest Version v8.8.2...

Can you provide a mini-CSV File (you need to zip it to be able to upload it to the Forum) to do some quick Testing...?

Easy Workaround I would think, if you are right with your Observations, would be to hard-code at the beginning (and/or end) of your Script an extra !USERAGENT Statement with your Current/Default UA...
- (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...
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: User agent not resetting after running my macro

Post by skippyto » Thu Aug 21, 2014 2:34 pm

Hi !

I experiment the same comportment (on latetst 8.8.2 extension with both FF30 and FF31), for example with the following

Code: Select all

SET !USERAGENT "Hello World"
URL GOTO=http://www.whatsmyuseragent.com/
WAIT SECONDS=5
"Hello World" will be my useragent until I close my browser. But, next time I open it, my true user agent is back.

For me it's not a issue, as I am playing many iim file in some js (and js close the browser at the end), I need to set my user agent only one time and not in each iim file.
I think anybody who launch iim with some scripts will prefer to set the user agent one time at the beginning.

I agree with chivracq, if you need to get back to your true user agent, just set it at the end of your iim.

Skippyto.
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: User agent not resetting after running my macro

Post by skippyto » Fri Sep 12, 2014 10:20 am

Hi !

Not sure if it's an issue or not, but since Fiferox the 8.8.3 version of iMacros addon, the user agent modified with "SET !USERAGENT" is not persistant after the end of the iim it was set in.

I prefer when it was lasting all the firefox's session as i had just to modify it one time à the beginning of my js script. Now, i have to write it at the beginning of all my iim script...

Skippyto
chivracq
Posts: 8765
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: User agent not resetting after running my macro

Post by chivracq » Fri Sep 12, 2014 5:43 pm

skippyto wrote:Hi !

Not sure if it's an issue or not, but since Fiferox the 8.8.3 version of iMacros addon, the user agent modified with "SET !USERAGENT" is not persistant after the end of the iim it was set in.

I prefer when it was lasting all the firefox's session as i had just to modify it one time à the beginning of my js script. Now, i have to write it at the beginning of all my iim script...

Skippyto
The Behaviour you describe with v8.8.3 sounds more like what is documented in the Wiki:
Firefox: The user agent string is reset after each invocation of your macro or script.

This page was last modified on 25 June 2011, at 12:13.
- (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