Jump to content

Is there an equivalent IE attach command for FF?


tommytx
 Share

Recommended Posts

Thanks JohnOne I got that set up and seems to be working ok.. but its still not letting me connect... here is what I got so far.

#include <FF.au3>

_FFStart("http://vahud.com")


If _FFIsConnected() Then
   consolewrite("Connected." & @CRLF)
    sleep(1000)
    _FFWindowSelect("Virginia Beach Real Estate For Sale! | Virginia Beach, VA Real Estate For Sale")
    endif

and here is the errors that it is giving.. me...

__FFStartProcess: ""C:\Program Files\Mozilla Firefox\firefox.exe" -new-window "http://vahud.com"  "-repl 4242 "
_FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3
_FFConnect: AutoIt: 3.3.12.0
_FFConnect: FF.au3: 0.6.0.1b-10
_FFConnect: IP: 127.0.0.1
_FFConnect: Port:   4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:     1648
_FFConnect: Browser:    Mozilla/5.0 (Windows NT 5.1; rv:35.0) Gecko/20100101 Firefox/35.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
_FFLoadWait: . loaded in 14ms
[object HTMLDocument] - {location: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, ...}
__FFSend: try{FFau3 != null?1:0}catch(e){'_FFCmd_Err';};
__FFRecv: 1
Connected.
__FFSend: try{FFau3.SelectWin('Virginia Beach Real Estate For Sale!','title','navigator:browser');}catch(e){'_FFCmd_Err';};
__FFRecv: _FFCmd_Err
_FFWindowSelect ==> No match: $sSearch: Virginia Beach Real Estate For Sale!
>Exit code: 0    Time: 5.865

IF anyone has any suggestions as to why I do not get a match i would appreciate it..

Link to comment
Share on other sites

I took a look at the JS code in the UDF, and I believe that I have a fix for the title search not working properly. Find the line

_FFCmd('FFau3.SelectWin=function SelectWin(a,b,c){var d;var e=Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getEnumerator(c);while(e.hasMoreElements()){d=e.getNext();switch(b){case"title":if(d.title.indexOf(a)!=-1){repl.enter(d);return 1};break;case"label":if(FFau3.SearchTab(a)>-1){repl.enter(d);return 1};break;case"href":for(var f=0; f < d.gBrowser.browsers.length; f++){var g=d.gBrowser.getBrowserAtIndex(f);if (RegExp(a).test(g.currentURI.spec)){repl.enter(g);return 1;}};break;default:return-1}}return-1};')

and replace it with

_FFCmd('FFau3.SelectWin=function SelectWin(a,b,c){var d;var e=Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getEnumerator(c);while(e.hasMoreElements()){d=e.getNext();switch(b){case"title":for(var f=0; f < d.gBrowser.browsers.length; f++){var g=d.gBrowser.getBrowserAtIndex(f);if (RegExp(a).test(g.contentTitle)){repl.enter(g);return 1;}};break;case"label":if(FFau3.SearchTab(a)>-1){repl.enter(d);return 1};break;case"href":for(var f=0; f < d.gBrowser.browsers.length; f++){var g=d.gBrowser.getBrowserAtIndex(f);if (RegExp(a).test(g.currentURI.spec)){repl.enter(g);return 1;}};break;default:return-1}}return-1};')

Please test and let me know how this change works for you.

Link to comment
Share on other sites

thanks for all that effort Universalist.. but what that did is bring up a blank new tab... and nothing else.. and I tried it using 3 differnet instance of firefox browser and also with one ff browser with 3 instances of tab... Thank you but don't waste more time on it as it may be realated to the fact that I am running XP and FF8... as that is the best XP can do... as its been abandoned..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...