Run Javascript in Browser

Run javascript code in browser.

Some functions in FMiner

fmget_targets(xpath, pos): Get the targets with "xpath" and "pos", the targets are DOM on page.

 

Do some special action

for example, FMiner just can fire "click" event, to fire "mousedown" event, you can write code like this:

var simulateMouseDown = function(element){
   var eventName = 'mousedown';
   if(element.dispatchEvent){
     var event = document.createEvent("MouseEvent");
     event.initMouseEvent(eventName, true, true, window);
     element.dispatchEvent(event);
  }else if(element.fireEvent){ // IE7 and below
     element.fireEvent('on'+eventName);
  }
};

Go back

history.back(-1)