tommytx

Is there an equivalent IE attach command for FF?

13 posts in this topic

Is there a FF command that is equal to the IE attach command?  Thanks

Share this post


Link to post
Share on other sites



Are you using the FF.au3 UDF? If so, take a look at _FFWindowSelect and _FFTabSetSelected.

Share this post


Link to post
Share on other sites

How do I know if I am using it... ? Is it something I need to search for and activate... I did not add anything to my basic autoit..

Share this post


Link to post
Share on other sites

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..

Share this post


Link to post
Share on other sites

_FFWindowSelect will work with a portion of the title. Try changing your line to:

_FFWindowSelect("Virginia Beach Real Estate")

Share this post


Link to post
Share on other sites

Also, there's an updated version of FF.au3, which you can download here.

Share this post


Link to post
Share on other sites

I did try with the line on the left side of the bar but it failed the same way.... i had already assumed it only needs part of the title..but will upload the new version and try again.. thanks

Share this post


Link to post
Share on other sites

Notice the new version has the version number as part of the file name... can someone tell me where I save this for upgrade and  do i need to change its name to FF.AU3 to make it get picked up.. Thanks

Share this post


Link to post
Share on other sites

This works:

_FFWindowSelect("vahud.com", 'href')

I'd have to look that the underlying code to figure out why the title search isn't working.

As far as the UDF name, you can just rename it to FF.au3 or change your script to use the different name.

Share this post


Link to post
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.

Share this post


Link to post
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..

Share this post


Link to post
Share on other sites

FWIW, all versions of FF run just fine on XP. :thumbsup:

Did you edit the UDF and replace the first line with the second one?

Share this post


Link to post
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