Jump to content

Firefox Instance Selection


Kashgari
 Share

Recommended Posts

Hi, I have not seen any thing in regard with this, but I believe it should be possible.

I am using a script on Firefox to automate some task but I also want to do some other work with firefox, but the script takes away active firefox window, I have tried to use different tab, or opening new firefox windows, but the script just launches on active window that I am using. What is the solution? I want to attach or assign a script to particular tab or firefox window.

Thanks.

Link to comment
Share on other sites

Hi, I have not seen any thing in regard with this, but I believe it should be possible.

I am using a script on Firefox to automate some task but I also want to do some other work with firefox, but the script takes away active firefox window, I have tried to use different tab, or opening new firefox windows, but the script just launches on active window that I am using. What is the solution? I want to attach or assign a script to particular tab or firefox window.

Thanks.

Takes the running script your active FireFox window?

Normaly not. _FFConnect uses the last opened FF-window.

You can assign the script to a window with _FFWindowSelect, but not to a tab.

Or you can made a connection to FF and open a new window for your script with _FFWindowOpen, or with _FFStart.

If you wanna work with FireFox while your script is running, just use another window.

Edited by Stilgar
Link to comment
Share on other sites

Takes the running script your active FireFox window?

Normaly not. _FFConnect uses the last opened FF-window.

You can assign the script to a window with _FFWindowSelect, but not to a tab.

Or you can made a connection to FF and open a new window for your script with _FFWindowOpen, or with _FFStart.

If you wanna work with FireFox while your script is running, just use another window.

You are right, after posting the topic I found out script takes last opened FF-window, including all its tabs, but I can just open another window. What happened is I have created a loop with two script which calls one after another, in this way I can not use firefox any windows as the loop keeps taking the new window, now I have created a loop in single script so problem solved.

_FFWindowOpen sounds a good way, I will spend some time learning it.

Thanks Stilgar, for your fast responce.

Link to comment
Share on other sites

@ StilGar

Strange things happening.

I am using following script which should be attached to Firefox, as you said to last windows, now it is again "running out of the fence", it now only fox various windows of firefox it also executes on other browser as well as text editing software.

This is the code:

#include <file.au3>
#Include <FF.au3>

Dim $aRecords
If Not _FileReadToArray("L:\recent.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
_FFConnect()
If _FFIsConnected() Then
                                                                                
For $x = 1 to $aRecords[0]
  _FFOpenUrl($aRecords[$x])
   Sleep(11000) 
  _FFLinkClick("Add to groups", "text")
     Sleep(2000)
For $count = 1 To 19
        Send("{TAB}")
Next
 Send("{SPACE}")
 Send("{TAB}")
 Send("{ENTER}")
 Sleep(9000)
 Next
EndIf

This is weird!

Edited by Kashgari
Link to comment
Share on other sites

@ StilGar

Strange things happening.

I am using following script which should be attached to Firefox, as you said to last windows, now it is again "running out of the fence", it now only fox various windows of firefox it also executes on other browser as well as text editing software.

This is the code:

...

This is weird!

That isn't weird :D

This lines:

For $count = 1 To 19
        Send("{TAB}")
Next
 Send("{SPACE}")
 Send("{TAB}")
 Send("{ENTER}")

are working on the active window not explicit on the FireFox window.

What are you doing with this Send commands in FireFox? Is think there would be a better solution.

Edited by Stilgar
Link to comment
Share on other sites

You are right the script has some problem for now. let me explain.

when I do this : _FFLinkClick("Add to groups", "text") all available check boxes will be dropped, I want to select the 19th, I can use _ffcheckbox to select 19th checkbox, but that check box need a click as there are 3 further dropdown options available within this checkbox, these three options is visible only when I click it (maybe some hidden javascript, or ajax,) not with _ffcheckbox.

So when script is running I can not do anything on my computer. I have to either find out ways to utilize ffclick after finding out more about the structure of the webpage, or find a way to bound this script with particular firefox instance which I do not know how.

thanks for your continues help.

Link to comment
Share on other sites

when I do this : _FFLinkClick("Add to groups", "text") all available check boxes will be dropped, I want to select the 19th, I can use _ffcheckbox to select 19th checkbox, but that check box need a click as there are 3 further dropdown options available within this checkbox, these three options is visible only when I click it (maybe some hidden javascript, or ajax,) not with _ffcheckbox.

At the moment you can simulate onchange (...) events with the function _FFDispatchEvent.

In the future they will be automaticly simulated by the _FFForm* functions.

19 checkboxes? Or is this an option-select?

Link to comment
Share on other sites

  • 1 year later...

It was interesting to come across this thread. I was hoping to run two (or more) Firefox instances simultaneously using FF.au3 but without much success.

I am launching each Firefox instance with a separate MozRepl port number (and with the -no-remote flag) but I am not able to successfully control the separate Firefox browsers using _FFconnect.

I had hoped that simultaneous, independent operation of multiple Firefox browser sessions was possible, has anyone been able to do this?

Much thanks for any advice

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