FF : 54
Win 7, 64bit
Good morning all,
With imacros javascript scripting, I created a small js script that fills out forms, browse and upload an image, register, retrieve the activation code by email and validate the account ...
To do this I used a lot of iimPlayCode() in my js.
Now I am limited because my js can only run with an older version of iMacros 8.9.7 with Firefox based browser. I cannot run my script in Opera, Chrome, or other browser. (It's unreliable to fake with the user agent).
So I plan to rewrite everything under Tampermonkey. In that case, do you have any idea how I can exploit imacros snippets in my new userscript?
Basically the Imacros commands I use revolve around:
Code: Select all
EVENT TYPE=CLICK
EVENTS TYPE=KEYPRESS
TAG POS=1 TYPE=INPUT:FILE
URL GOTO=
WAIT SECONDS=
with Components such us :
Code: Select all
const XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsIXMLHttpRequest");
Components.utils.import("resource://gre/modules/Services.jsm");
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils);
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
var window = wm.getMostRecentWindow("navigator:browser");
var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindow);