how to CLEAR instead of restarting firefox

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
alete
Posts: 13
Joined: Sun Sep 07, 2014 11:03 pm

how to CLEAR instead of restarting firefox

Post by alete » Sun Sep 07, 2014 11:26 pm

Hi, I promise I did a research both here and in google, but couldnt find any successfull help.
I have this .js that executes a few macros that fill forms for me, I needed to use JS because i had iterations, conditional, etc. I need to fill forms from different users and also differents IP addresses (this is not the problem, wich i already solved executing a batch file from my .js that refresh my IP), but in order to iterate the whole process I need the macro to log-out and log-in again. HERE is the problem, where the site knows that it's me (the same person) even when I changed my IP address, I tried to clear cookies from javascript unsuccessfully, thats why I'm here asking if any of you ever been in a similar circumstance and know how to deal with it. I've already tried with CLEAR inside the .iim, and with different methods to delete cookies in javascript (or setting them as expired) but nothing is sufficiently "deep" as restarting firefox (wich works, but off course im trying to avoid that for obvious reasons)

Right now i'm using firefox 27 with iMacros for FF plugin 8.8.2 in win7-64bit

attach the .js for you to have an overview

Code: Select all

var i = 0
function sleep(milliseconds) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
    if ((new Date().getTime() - start) > milliseconds){
      break;
    }
  }
}
while(i<=6){
var apis = [
	"api1",
	"api2",
	"api3",
	"api4",
	"api5",
	"api6",
	"api7"]
iimSet("thisapi",apis[i])
iimPlay('pre.iim')
iimPlay('mid.iim')
var ex_val = iimGetExtract()

if(ex_val =="#EANF#"  ex_val ==null || ex_val =="" ) //any error
{
iimPlay('mid.iim')
}
else
{
iimSet("ex",ex_val)
iimPlay('post.iim')
}
i++
}
var reconnect= Components.classes["@mozilla.org/file/local;1"]
                     .createInstance(Components.interfaces.nsILocalFile);
reconnect.initWithPath("c:\\recon.bat");
reconnect.launch();
sleep(10000);
}

Thanks :)
Post Reply