Jump to content

FF.au3 (V0.6.0.1b-10)


Stilgar
 Share

Recommended Posts

Hi, it may be some out of subject, it web-browser working with AUTOIT, like ff, but in a reverse-engineering mode.

I dream if there is some plugin for firefox where you can remap any au3 into an html format output(http://www.anyserver.com/myau3file.au3), so that you can read this au3 file from a web-browser, by example, you have a msgbox() and you get a vbscript-msgbox in the proper format. Or you have a gui, and you get an html form.

Or may be something like the flash-player, to open and process au3.files?

Is something done about it?

Salud

This guy made a flash gui, could it be worked out from the web browser directly?

http://www.autoitscript.com/forum/index.php?showtopic=116813

Edited by BasicOs
Autoit.es - Foro Autoit en Español Word visitors Image Clustrmap image: - Football Spanish team - Spanish team: Casillas, Iniesta, Villa, Xavi, Puyol, Campdevilla, etc..Programando en Autoit+Html - Coding Autoit-Html - Arranca programas desde Internet - Preprocesador de Autoit a http
Link to comment
Share on other sites

Hi! Just trying use this FireFox automation for my needs due to IE limitations. First I decided to compile FF-Page-Analyzer, but got these errors:

D:\KB\2010-06-19 AutoIt3 Scripts\2010-07-08 Prices Automation\FireFox\FF-Page_Analyzer.au3(328,15) : ERROR: AdlibDisable(): undefined function.
    AdlibDisable()
    ~~~~~~~~~~~~~^
D:\KB\2010-06-19 AutoIt3 Scripts\2010-07-08 Prices Automation\FireFox\FF-Page_Analyzer.au3(349,37) : ERROR: _FFFrameGetSelected(): undefined function.
            Local $tmp = _FFFrameGetSelected()
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\KB\2010-06-19 AutoIt3 Scripts\2010-07-08 Prices Automation\FireFox\FF-Page_Analyzer.au3(366,35) : ERROR: AdlibEnable(): undefined function.
    AdlibEnable("_getURL", $iURLTimer)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\KB\2010-06-19 AutoIt3 Scripts\2010-07-08 Prices Automation\FireFox\FF-Page_Analyzer.au3 - 3 error(s), 0 warning(s)

Should I add something somewhere? Remove AdlibDisable with AdlibUnregister and etc? _FFFrameGetSelected I found only in analyser source and help file, where is the code itself? Please help me or correct the source on first page.

Link to comment
Share on other sites

  • 2 weeks later...

I've used FF.au3 to do some basic things, mainly retrieving data from web pages. And I've played around with the download manager udf based on it to create my own little custom monitor. I've been looking around and I can't see anything on reading or writing firefox bookmarks. Is this possible to do? If so, what commands should I be playing with.

Are their any existing udfs I should be looking at that I missed?

Link to comment
Share on other sites

  • 4 weeks later...

I have modified the FF page Analyser but i have som issue

What it's wrong please .

I am on 3.3.6.1

Thanks ;)

; :collapseFolds=1:maxLineLen=80:mode=autoitscript:tabSize=8:indentSize=8:folding=indent:
;Global Const $__DEBUG__ = False ;#__DEBUG__
Opt("TrayIconHide", 1) ;0=show, 1=hide tray icon

#Region Info
#cs
    Sat Apr 11 19:00:34 CEST 2009 @750 /Internet Time/

    V0.999.6
    - fixed some warnings from Au3Check

    V0.999.5
    * fixed error in forms, if ids and names are mixed

    V0.999.4
    * fixed error with img-tags without src-attribute

    V0.999.3
    * optimized performance
    * fixed problem with frames
    * fixed error with _FFClick and name-index
    * fixed error with _FFFrameEnter("top")

    V0.999.2 Updated for FF.au3 >V0.5.3.0
    * Updated all login-function-templates

    V0.999.1 Updated for FF.au3 >V0.5.x.x

    V0.999  * Updated to the latest FF.au3
    * Changed the function to the check page status

    V0.998  * Updated to the latest FF.au3
    V0.996:
    * Speicherverbrauch gesenkt (um bis zu 11MB)
    * Bei Up-Down in der Befehlsliste bleibt der entsprechende Eintrag nun markiert.
    * Fehlermeldung von "_FFFrameEnter ==> Socket error" in EXE behoben.
    * "Run" funktioniert nun auch bei kompliertem Script

    V0.995:
    * Verschiedene Arten von Login-Scripten koennen nun erzeugt werden, inkl.
    einem Tepmplate (in der INI) zum Erzeugen einer Login-Funktion.

    Folgende Platzhalter werden durch die entsprechenden Funktionen ersetzt:
    %url    = Aufruf der URL (setzt @error)
    %name   = Setzen des Benutzernamens (return = eingabe)
    %pass   = Setzen des Passwortes (return = eingabe)
    %submit = Absenden des Formulares (setzt @error)
    |       = Zeilenumbruch

    V0.994:
    * Funktion zum Erzeugen eines Login-Scriptes eingebaut

    V0.993:
    * Befehle koennen nun sortiert werden und gestartet werden

    V0.992:
    * Transparenz kann nun eingestellt werden
    * Bei Image-Links mit Javascript als HREF wird nun auch die Bild-SRC angezeigt
    * Fehler beim Index mehrfach vorhandener Namen behoben
    * Fehler in URL-Anzeige im Fenstertitel behoben.
    * Mehrere Optimierungen in readForms, createCommand
#ce
#EndRegion Info

#Region Includes
#include <Array.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <File.au3>
#include <FF.au3>
#include <GUIConstantsEx.au3>
#include <GuiComboBox.au3>
#include <GuiListBox.au3>
#include <GuiTreeView.au3>
#include <WindowsConstants.au3>
#EndRegion Includes

#Region Global Vars
Global $sGUI_Title = "FF - Page Analyzer"
Global $sGUI_Version = "V0.999.6"
Global $sTreeURL
Global $aTreeFrames[1]
Global $iURLTimer
Global $_sURL
Global $sTemplate_Function
; Transparency
Global $aMenu_ViewTrans[4][2]
$aMenu_ViewTrans[0][1] = 255 ; 0%
$aMenu_ViewTrans[1][1] = 230 ; 10%
$aMenu_ViewTrans[2][1] = 204 ; 20%
$aMenu_ViewTrans[3][1] = 179 ; 30%
#EndRegion Global Vars

#Region GUI
;===============================================================================
Global $Win_Main = GUICreate($sGUI_Title, 388, 572, 250, 106, -1, $WS_EX_TOPMOST)
Global $Input_URL = GUICtrlCreateInput("http://www.google.fr", 8, 8, 260, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
Global $List_Frame = GUICtrlCreateCombo("top", 276, 8, 40, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetTip(-1, "Frame")
Global $Button_Analyze = GUICtrlCreateButton("Analyze", 320, 6, 60, 25)

GUICtrlCreateGroup("", 8, 30, 370, 300)
Global $Tree_Forms = GUICtrlCreateTreeView(16, 42, 356, 280)
Global $Tree_Context = GUICtrlCreateContextMenu($Tree_Forms)
Global $Tree_Context1 = GUICtrlCreateMenuItem("Create Command", $Tree_Context)
GUICtrlCreateGroup("", -99, -99, 1, 1)

GUICtrlCreateGroup("Options:", 8, 336, 370, 70)
;GUICtrlCreateLabel("Socket:", 16, 358, 41, 17)
;Global $Input_Socket = GUICtrlCreateInput("$Socket", 64, 354, 89, 21)
Global $Select_UseIndex = GUICtrlCreateCheckbox("Use Index", 256, 354, 110, 21)
GUICtrlCreateLabel("Action:", 16, 382, 34, 17)
Global $List_SetGet = GUICtrlCreateCombo("Set Value", 64, 378, 90, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Get Value|Check|Uncheck|Click Link|Click Element|Form Submit|Form Reset")
Global $Value_Combo = GUICtrlCreateCombo("$sValue", 160, 378, 89, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Variable|Fixed")
Global $Input_Variable = GUICtrlCreateInput("$sValue", 256, 378, 116, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Global $List_Commands = GUICtrlCreateList("", 8, 412, 370, 82, BitOR($WS_VSCROLL, $WS_HSCROLL))
; -- List-Menu
Global $List_Context = GUICtrlCreateContextMenu($List_Commands)
Global $List_Context_Del = GUICtrlCreateMenuItem("Delete", $List_Context)
Global $List_Context_Reset = GUICtrlCreateMenuItem("Delete All", $List_Context)
GUICtrlCreateMenuItem("", $List_Context)
Global $List_Context_Copy = GUICtrlCreateMenuItem("Copy to Clipboard", $List_Context)
Global $List_Context_CopyAll = GUICtrlCreateMenuItem("Copy all to Clipboard", $List_Context)
GUICtrlCreateMenuItem("", $List_Context)
Global $List_FFStart = GUICtrlCreateMenuItem("Add _FFStart", $List_Context)
Global $List_FFQuit = GUICtrlCreateMenuItem("Add _FFQuit", $List_Context)
Global $List_FFConnect = GUICtrlCreateMenuItem("Add _FFConnect", $List_Context)
Global $List_FFDisConnect = GUICtrlCreateMenuItem("Add _FFDisConnect", $List_Context)
Global $List_FFOpenURL = GUICtrlCreateMenuItem("Add _FFOpenURL", $List_Context)
Global $List_FFFrameEnter = GUICtrlCreateMenuItem("Add _FFFrameEnter", $List_Context)
Global $List_FFFrameLeave = GUICtrlCreateMenuItem("Add _FFFrameLeave", $List_Context)
;---
Global $List_Up = GUICtrlCreateButton("Up", 8, 500, 60, 25)
Global $List_Down = GUICtrlCreateButton("Down", 72, 500, 60, 25)
Global $List_Run = GUICtrlCreateButton("Run", 285, 500, 100, 25)

; - Status
Global $Status = GUICtrlCreateInput("", 2, 528, 280, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
Global $Progress_1 = GUICtrlCreateProgress(285, 528, 100, 10)
Global $Progress_2 = GUICtrlCreateProgress(285, 540, 100, 10)
; --- Menu
; -------- Options
Global $Menu_Options = GUICtrlCreateMenu("Options")
Global $Menu_Options1 = GUICtrlCreateMenuItem("Append", $Menu_Options)
GUICtrlCreateMenuItem("", $Menu_Options)
Global $Menu_Options_GetForm = GUICtrlCreateMenuItem("Get Forms", $Menu_Options)
GUICtrlSetState(-1, $GUI_CHECKED)
;Global $Menu_Options_Form = GUICtrlCreateMenu("Forms ...", $Menu_Options)
;Global $Menu_Options_GetFormID = GUICtrlCreateMenuItem("IDs", $Menu_Options_Form)
GUICtrlCreateMenuItem("", $Menu_Options)
Global $Menu_Options_GetLinks = GUICtrlCreateMenuItem("Links", $Menu_Options)
Global $Menu_Options_Links = GUICtrlCreateMenu("Links ...", $Menu_Options)
Global $Menu_Options_GetLinksName = GUICtrlCreateMenuItem("NAME", $Menu_Options_Links)
Global $Menu_Options_GetLinksID = GUICtrlCreateMenuItem("IDs", $Menu_Options_Links)
Global $Menu_Options_GetLinksHASH = GUICtrlCreateMenuItem("HASH", $Menu_Options_Links)
Global $Menu_Options_GetLinksTARGET = GUICtrlCreateMenuItem("TARGET", $Menu_Options_Links)
GUICtrlCreateMenuItem("", $Menu_Options)
Global $Menu_Options_Copy = GUICtrlCreateMenuItem("Copy To Clipboard", $Menu_Options)
GUICtrlSetState(-1, $GUI_CHECKED)

; -------- View
Global $Menu_View = GUICtrlCreateMenu("View")
;Global $Menu_View_OnTop = GUICtrlCreateMenuItem("Always On Top",$Menu_View)
Global $Menu_ViewTrans = GUICtrlCreateMenu("Transparency ...", $Menu_View)
$aMenu_ViewTrans[0][0] = GUICtrlCreateMenuItem("Off", $Menu_ViewTrans, 0, 1)
$aMenu_ViewTrans[1][0] = GUICtrlCreateMenuItem("10%", $Menu_ViewTrans, 1, 1)
$aMenu_ViewTrans[2][0] = GUICtrlCreateMenuItem("20%", $Menu_ViewTrans, 2, 1)
$aMenu_ViewTrans[3][0] = GUICtrlCreateMenuItem("30%", $Menu_ViewTrans, 3, 1)
; -------- Tools
Global $Menu_Tools = GUICtrlCreateMenu("Tools")
Global $Menu_Tools_Login = GUICtrlCreateMenuItem("Create Login Commands ...", $Menu_Tools)
Global $Menu_Tools_Login_Script = GUICtrlCreateMenuItem("Create Login Script ...", $Menu_Tools)
Global $Menu_Tools_Login_Func = GUICtrlCreateMenuItem("Create Login Function ...", $Menu_Tools)
GUICtrlCreateMenuItem("", $Menu_Tools)
Global $Menu_Tools1 = GUICtrlCreateMenuItem("Reconnect", $Menu_Tools)
; -------- Help
Global $Menu_Help = GUICtrlCreateMenu("Help")
Global $Menu_Help1 = GUICtrlCreateMenuItem("About ...", $Menu_Help)

readINI(@ScriptDir & "\FF-Page_Analyzer.ini")
GUISetState(@SW_SHOW)
#EndRegion GUI

$_FF_COM_TRACE = True
;===============================================================================
getMsg()
Exit
;===============================================================================
Func getMsg()
    Local $tmp = "", $sFile

    While 1
        Sleep(20)
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                writeINI(@ScriptDir & "\FF-Page_Analyzer.ini")
                Exit
            Case $Button_Analyze
                Analyze(GUICtrlRead($List_Frame))
                _ReduceMemory()
            Case $Tree_Context1
                createCommand()
            Case $List_Context_Del
                _GUICtrlListBox_DeleteString($List_Commands, _GUICtrlListBox_GetCurSel($List_Commands))
            Case $List_Up
                $tmp = _GUICtrlListBox_GetCurSel($List_Commands)
                _GUICtrlListBox_SwapString($List_Commands, $tmp - 1, $tmp)
                _GUICtrlListBox_SetCurSel($List_Commands, $tmp - 1)
            Case $List_Down
                $tmp = _GUICtrlListBox_GetCurSel($List_Commands)
                _GUICtrlListBox_SwapString($List_Commands, $tmp + 1, $tmp)
                _GUICtrlListBox_SetCurSel($List_Commands, $tmp + 1)
            Case $List_Run
                GUICtrlSetData($Status, "Executing Script ...")
                $tmp = "#include <FF.au3>" & @CRLF
                For $i = 0 To _GUICtrlListBox_GetCount($List_Commands) - 1
                    $tmp &= _GUICtrlListBox_GetText($List_Commands, $i) & @CRLF
                Next
                $sFile = _TempFile()
                If FileWrite($sFile, $tmp) Then
                    RunWait(@ProgramFilesDir & "\AutoIt3\AutoIt3.exe " & $sFile, @ScriptDir)
                    FileDelete($sFile)
                EndIf
                GUICtrlSetData($Status, "")
                _ReduceMemory()
            Case $List_Context_Copy
                ClipPut(_GUICtrlListBox_GetText($List_Commands, _GUICtrlListBox_GetCurSel($List_Commands)))
            Case $List_Context_CopyAll
                copyAll2ClipBoard()
            Case $List_FFStart
                If __FFIsURL($_sURL) Then _GUICtrlListBox_InsertString($List_Commands, '_FFStart("' & $_sURL & '", Default, 2)')
            Case $List_FFConnect
                _GUICtrlListBox_InsertString($List_Commands, "_FFConnect()")
            Case $List_FFOpenURL
                If __FFIsURL($_sURL) Then _GUICtrlListBox_InsertString($List_Commands, '_FFOpenURL("' & $_sURL & '")')
            Case $List_FFQuit
                _GUICtrlListBox_InsertString($List_Commands, "_FFQuit()")
            Case $List_FFDisConnect
                _GUICtrlListBox_InsertString($List_Commands, "_FFDisConnect()")
            Case $List_Context_Reset
                _GUICtrlListBox_ResetContent($List_Commands)
            Case $List_FFFrameEnter
                $tmp = GUICtrlRead($List_Frame)
                If Not StringRegExp($tmp,"[0-9]") Then $tmp = "'" & $tmp & "','name'"
                _GUICtrlListBox_InsertString($List_Commands, "_FFFrameEnter(" & $tmp & ")")
            Case $List_FFFrameLeave
                _GUICtrlListBox_InsertString($List_Commands, "_FFFrameLeave()")
            Case $List_SetGet
                onchangeAction()
            Case $Value_Combo
                onchangeValue()
            Case $Menu_Tools_Login
                createLogin(0)
            Case $Menu_Tools_Login_Script
                createLogin(1)
            Case $Menu_Tools_Login_Func
                createLogin(2)
            Case $Menu_Tools1
                reconnectFF()
                _ReduceMemory()
            Case $aMenu_ViewTrans[0][0]
                WinSetTrans($Win_Main, "", $aMenu_ViewTrans[0][1])
            Case $aMenu_ViewTrans[1][0]
                WinSetTrans($Win_Main, "", $aMenu_ViewTrans[1][1])
            Case $aMenu_ViewTrans[2][0]
                WinSetTrans($Win_Main, "", $aMenu_ViewTrans[2][1])
            Case $aMenu_ViewTrans[3][0]
                WinSetTrans($Win_Main, "", $aMenu_ViewTrans[3][1])
            Case $Menu_Options1
                Toggle($Menu_Options1)
            Case $Menu_Options_GetForm
                Toggle($Menu_Options_GetForm)
            Case $Menu_Options_GetLinks
                Toggle($Menu_Options_GetLinks)
            ;Case $Menu_Options_GetFormID
            ;   Toggle($Menu_Options_GetFormID)
            Case $Menu_Options_Copy
                Toggle($Menu_Options_Copy)
            Case $Menu_Options_GetLinksName
                Toggle($Menu_Options_GetLinksName)
            Case $Menu_Options_GetLinksID
                Toggle($Menu_Options_GetLinksID)
            Case $Menu_Options_GetLinksHASH
                Toggle($Menu_Options_GetLinksHASH)
            Case $Menu_Options_GetLinksTARGET
                Toggle($Menu_Options_GetLinksTARGET)
            Case $Menu_Help1
                WinSetOnTop($Win_Main, "", 0)
                MsgBox(64 + 262144, "About ...", $sGUI_Title & @CRLF & $sGUI_Version & ", by thorsten.willert" & Chr(64) & "gmx.de")
                WinSetOnTop($Win_Main, "", 1)
        EndSwitch
    WEnd
EndFunc   ;==>getMsg
;===============================================================================
Func connect()
    If $_FF_GLOBAL_SOCKET = -1 Then _FFConnect(Default, Default, 10000)
    If Not IsChecked($Menu_Options1) Then _GUICtrlTreeView_DeleteAll($Tree_Forms)

    Local $sURL = _FFCmd(".location.href")

    If StringLen($sURL) > 50 Then
        GUICtrlSetData($Input_URL, StringLeft($sURL, 50) & "...")
    Else
        GUICtrlSetData($Input_URL, $sURL)
    EndIf
    $_sURL = $sURL

    GUICtrlSetData($List_Frame, "|top")
    Local $iFrames = _FFGetLength("frames")
    If $iFrames > 1 Then
        For $i = 0 To $iFrames - 1
            GUICtrlSetData($List_Frame, $i, 0)
        Next
        GUICtrlSetState($List_Frame, $GUI_ENABLE)
    Else
        GUICtrlSetState($List_Frame, $GUI_DISABLE)
    EndIf

    Return 1
EndFunc   ;==>connect
;===============================================================================
Func Analyze($vFrame)
    AdlibUnRegister()

    Local $Timer = TimerInit()

    If _FFIsConnected() Then
        _FFFrameEnter($vFrame, "name")
        If @error Then _FFFrameEnter(Int($vFrame))
    EndIf

    If connect() Then
        GUICtrlSetState($Button_Analyze, $GUI_DISABLE)
        Do
            Sleep(50)
        Until IsLoaded()

        _GUICtrlTreeView_BeginUpdate($Tree_Forms)

        If $_sURL <> "about:blank" Then
            $sTreeURL = GUICtrlCreateTreeViewItem($_sURL, $Tree_Forms)
            _GUICtrlTreeView_SetBold($Tree_Forms, $sTreeURL)

            Local $tmp = _FFCmd("window.frames[0].document.getSelection")
            If $tmp <> '"top"' Then GUICtrlCreateTreeViewItem("FRAMES[" & $tmp & "] - NAME: " & _FFCmd("window.frames[0].document.name"), $sTreeURL)
            GUICtrlCreateTreeViewItem("TITLE: " & _FFCmd(".title"), $sTreeURL)
            If IsChecked($Menu_Options_GetForm) Then readForms()
            If IsChecked($Menu_Options_GetLinks) Then readLinks()

            GUICtrlSetData($List_Frame, StringReplace($tmp, '"', ""))
            GUICtrlSetData($Status, "Analyzed in: " & Round(TimerDiff($Timer)) & "ms")
        EndIf

        _GUICtrlTreeView_EndUpdate($Tree_Forms)
        GUICtrlSetState($Button_Analyze, $GUI_ENABLE)
    Else
        GUICtrlSetData($Status, "ERROR: Can't open connection to FireFox")
    EndIf
    _FFFrameLeave()

    AdlibUnRegister()

    Return
EndFunc   ;==>Analyze
;===============================================================================
Func readForms()
    Local $iForms, $iFormsElements, $iOptions, $sValue, $iIndex = 0
    Local $sID, $sType, $sName, $sInfos, $aInfos
    Local $hOptions
    Local $aTreeItem[1]
    Local $aTreeElements[1]
    Local $vTmp

    $iForms = _FFGetLength("forms")
    ReDim $aTreeItem[$iForms + 1]

    If $iForms > 0 Then

        For $i = 0 To $iForms - 1 ; Forms

            GUICtrlSetData($Progress_1, 100 / $iForms * ($i + 1))
            ; forms[n].name
            $sName = _FFCmd(".forms[" & $i & "].name")
            $aTreeItem[$i] = GUICtrlCreateTreeViewItem("forms[" & $i & "] - NAME: " & $sName, $sTreeURL)
            _GUICtrlTreeView_SetBold($Tree_Forms, $aTreeItem[$i])

            If $sName <> "" Then
                $sID = _FFXPath("//form[@name='" & $sName & "']","id",9)
            Else
                $sID = _FFCmd(".forms[" & $i & "].id")
            EndIf
            If $sID <> "" Then GUICtrlCreateTreeViewItem("ID: " & $sID, $aTreeItem[$i])

            ; form[n].elements.length
            $iFormsElements = _FFCmd(".forms[" & $i & "].elements.length")

            If $iFormsElements > 0 Then
                ReDim $aTreeElements[$iFormsElements]

                For $j = 0 To $iFormsElements - 1 ; Elements
                    GUICtrlSetData($Progress_2, 100 / $iFormsElements * ($j + 1))

                    GUICtrlSetData($Status, "Analyzing forms[" & $i & "].elements[" & $j & "] ...")

                    _FFCmd("FFau3.obj=window.content.document.forms[" & $i & "].elements[" & $j & "]")

                    $sInfos = "FFau3.obj.type+'|'+FFau3.obj.name+'|'+FFau3.obj.id+'|'+FFau3.obj.value+'|'+FFau3.obj.checked+'|'+FFau3.obj.selectedIndex"
                    $sInfos = _FFCmd($sInfos)
                    ConsoleWrite($sInfos & @crlf & @crlf)
                    If Not @error Then
                        $aInfos = StringSplit($sInfos,"|",2)
                        If Ubound($aInfos) < 6 Then ContinueLoop
                    EndIf

                    $sType = $aInfos[0]
                    $sName = $aInfos[1]

                    $aTreeElements[$j] = GUICtrlCreateTreeViewItem("elements[" & $j & "] - NAME: " & $sName, $aTreeItem[$i])

                    $sID = $aInfos[2]
                    If $sID <> "" Then GUICtrlCreateTreeViewItem("ID: " & $sID, $aTreeElements[$j])

                    ; forms[n].elements[n].NAME.length (e.g. RadioButtons)
                    If StringLen($sName) > 0 And(StringInStr($sType, "radio") Or StringInStr($sType, "check")) Then
                        ; Filter fuer (beliebte) unzulaessige Zeichen in HTMl-Bezeichnern
                        $sName = StringRegExpReplace($sName, "[\[\]\(\)]", "")

                        $vTmp = _FFCmd(StringFormat(".getElementsByName('%s').length",$sName))
                        If $vTmp > 0 Then
                            GUICtrlCreateTreeViewItem("INDEX: " & $iIndex, $aTreeElements[$j])
                            $iIndex += 1
                        EndIf
                        If $iIndex >= $vTmp Then $iIndex = 0
                    EndIf

                    ; forms[n].elements[n].type
                    GUICtrlCreateTreeViewItem("TYPE: " & $sType, $aTreeElements[$j])

                    ; forms[n].elements[n].value
                    $sValue = $aInfos[3]
                    GUICtrlCreateTreeViewItem("VALUE: " & $sValue, $aTreeElements[$j])

                    ; forms[n].elements[n].checked
                    If StringInStr($sType, "radio") Or StringInStr($sType, "check") Then
                        GUICtrlCreateTreeViewItem("CHECKED: " &$aInfos[4], $aTreeElements[$j])
                    EndIf

                    If StringInStr($sType, "select") Then
                        ; forms[n].elements[n].selectedIndex
                        GUICtrlCreateTreeViewItem("SELECTED INDEX: " & $aInfos[5], $aTreeElements[$j])

                        ; forms[n].elements[n].options.length
                        $iOptions = _FFCmd(".forms[" & $i & "].elements[" & $j & "].options.length")
                        $hOptions = GUICtrlCreateTreeViewItem("options:", $aTreeElements[$j])

                        If $iOptions > 0 Then
                            For $k = 0 To $iOptions - 1 ; Options
                                ; forms[n].elements[n].options[n].value
                                GUICtrlCreateTreeViewItem("options[" & $k & "] - VALUE: " & _FFCmd(".forms[" & $i & "].elements[" & $j & "].options[" & $k & "].value"), $hOptions)
                            Next ; Options
                        EndIf
                    EndIf ; StringInStr($sType, "select")

                Next ; Elements
            EndIf ; iElements > 0
        Next ; Forms
        GUICtrlSetData($Status, "")
    Else ; $iForms > 0
        GUICtrlSetData($Status, "No forms found!")
        _FFAction("resetconsole")
    EndIf ; $iForms > 0

    GUICtrlSetData($Progress_1, 0)
    GUICtrlSetData($Progress_2, 0)
    Return
EndFunc   ;==>readForms
;===============================================================================
Func readLinks()
    Local $aTreeLinks[1], $aRegEx

    Local $iLinks = _FFGetLength("links")
    ReDim $aTreeLinks[$iLinks + 1]

    If $iLinks > 0 Then
        Local $aLinks = _FFLinksGetAll()

        For $i = 0 To $iLinks - 1 ; Links
            GUICtrlSetData($Progress_1, 100 / $iLinks * ($i + 1))
            GUICtrlSetData($Status, "Analyzing links[" & $i & "] ...")

            If StringInStr($aLinks[$i][6], "<img ") > 0 Then
                $aRegEx = StringRegExp($aLinks[$i][6], '<img[ ]+(.*?)alt[ ]*=[ ]*\"(.*?)\"', 1)

                If Not @error And IsArray($aRegEx) Then $aTreeLinks[$i] = GUICtrlCreateTreeViewItem("links[" & $i & "] - IMAGE: " & $aRegEx[1], $sTreeURL)
            Else
                $aTreeLinks[$i] = GUICtrlCreateTreeViewItem("links[" & $i & "] - TEXT: " & $aLinks[$i][5], $sTreeURL)
            EndIf

            _GUICtrlTreeView_SetBold($Tree_Forms, $aTreeLinks[$i])

            Select
                Case StringInStr($aLinks[$i][0], "javascript:") > 0
                    GUICtrlCreateTreeViewItem("TYPE: javascript", $aTreeLinks[$i])
                    $aRegEx = StringRegExp($aLinks[$i][6], '<img[ ]+(.*?)src[ ]*=[ ]*\"(.*?)\"', 1)
                    If Not @error Then GUICtrlCreateTreeViewItem("IMAGE: " & $aRegEx[1], $aTreeLinks[$i])
                Case StringInStr($aLinks[$i][6], "<img ") > 0
                    GUICtrlCreateTreeViewItem("TYPE: imglink", $aTreeLinks[$i])
                    $aRegEx = StringRegExp($aLinks[$i][6], '<img[ ]+(.*?)src[ ]*=[ ]*\"(.*?)\"', 1)
                    If Not @error Then
                        GUICtrlCreateTreeViewItem("IMAGE: " & $aRegEx[1], $aTreeLinks[$i])
                    Else
                        GUICtrlCreateTreeViewItem("IMAGE: ERROR: NO SOURCE", $aTreeLinks[$i])
                        ConsoleWrite("Error: NO SOURCE: " & $aLinks[$i][6])
                    EndIf
                Case Else
                    GUICtrlCreateTreeViewItem("TYPE: link", $aTreeLinks[$i])
            EndSelect

            GUICtrlCreateTreeViewItem("HREF: " & $aLinks[$i][0], $aTreeLinks[$i])

            If IsChecked($Menu_Options_GetLinksHASH) Then
                If $aLinks[$i][1] <> "" Then GUICtrlCreateTreeViewItem("HASH: " & $aLinks[$i][1], $aTreeLinks[$i])
            EndIf

            If IsChecked($Menu_Options_GetLinksName) Then
                If $aLinks[$i][3] <> "" Then GUICtrlCreateTreeViewItem("NAME: " & $aLinks[$i][3], $aTreeLinks[$i])
            EndIf

            If IsChecked($Menu_Options_GetLinksID) Then
                If $aLinks[$i][4] <> "" Then GUICtrlCreateTreeViewItem("ID: " & $aLinks[$i][4], $aTreeLinks[$i])
            EndIf

            GUICtrlSetData($Progress_2, 100)
            If IsChecked($Menu_Options_GetLinksTARGET) Then
                If $aLinks[$i][7] <> "" Then GUICtrlCreateTreeViewItem("TARGET: " & $aLinks[$i][7], $aTreeLinks[$i])
            EndIf
        Next

        GUICtrlSetData($Status, "")
    Else ; $iLinks > 0
        GUICtrlSetData($Status, "No links found!")
        _FFAction("resetconsole")
    EndIf ; $iLinks > 0

    GUICtrlSetData($Progress_1, 0)
    GUICtrlSetData($Progress_2, 0)
    Return

EndFunc   ;==>readLinks
;===============================================================================
Func createCommand()
    AdlibUnRegister()

    Local $hCurrent = _GUICtrlTreeView_GetSelection($Tree_Forms)
    Local $sItem = _GUICtrlTreeView_GetText($Tree_Forms, $hCurrent)

    If StringInStr($sItem, "elements[") = 0 And StringInStr($sItem, "links[") = 0 Then
        GUICtrlSetData($Status, 'Select "elements[n]" or "links[n] ...')
        Return
    EndIf
    GUICtrlSetData($Status, "")

    Local $sTmp
    Local $sCommand
    ; NAME, INDEX
    $sItem = _GUICtrlTreeView_GetTree($Tree_Forms, 0)
    Local $aArray = StringSplit($sItem, "|")
    ;_ArrayDisplay($aArray)
    Local $sForm = StringLeft($aArray[2], StringInStr($aArray[2], "]"))
    Local $sFormName = StringMid($aArray[2], StringInStr($aArray[2], "NAME:") + 6)
    If UBound($aArray) = 4 Then
        Local $sElements = StringLeft($aArray[3], StringInStr($aArray[3], "]"))
        Local $sElementsName = StringMid($aArray[3], StringInStr($aArray[3], "NAME:") + 6)
    EndIf

    ; LINK INDEX
    Local $iLink = StringLeft($aArray[2], StringInStr($aArray[2], "]"))

    ; TYPE
    Local $hType = _GUICtrlTreeView_FindItem($Tree_Forms, "TYPE:", True, $hCurrent)
    Local $sType = _GUICtrlTreeView_GetText($Tree_Forms, $hType)
    $sType = StringMid($sType, StringInStr($sType, ":") + 2)

    ; INDEX
    Local $bIndex = BitAND(GUICtrlRead($Select_UseIndex), $GUI_CHECKED)
    $hType = _GUICtrlTreeView_FindItem($Tree_Forms, "INDEX:", True, $hCurrent)
    If $hType <> 0 Then
        Local $sIndex = _GUICtrlTreeView_GetText($Tree_Forms, $hType)
        $sIndex = StringRegExpReplace($sIndex, "(\[|\]|INDEX:|-| )", "")
    Else
        $sIndex = 0
    EndIf

    ; HREF
    $hType = _GUICtrlTreeView_FindItem($Tree_Forms, "HREF:", True, $hCurrent)
    If $hType <> 0 Then
        Local $sHREF = _GUICtrlTreeView_GetText($Tree_Forms, $hType)
        $sHREF = StringMid($sHREF, StringInStr($sHREF, ":") + 2)
    Else
        $sHREF = ""
    EndIf

    ; Variable
    $sTmp = GUICtrlRead($Input_Variable)
    Local $sVariable
    Local $aVariable[2] = ['"%1"', Chr(34) & "' & %1 & '" & Chr(34)]
    ; --- check $x
    If GUICtrlRead($Value_Combo) = "Variable" Then
        If StringLeft($sTmp, 1) <> "$" Then
            $sTmp = "$" & $sTmp
            If StringLen($sTmp) = 1 Then $sTmp = "$sValue"
            GUICtrlSetData($Input_Variable, $sTmp)
        EndIf
    EndIf
    Select
        Case GUICtrlRead($List_SetGet) = "Set Value" And GUICtrlRead($Value_Combo) <> "Fixed"
            Switch $bIndex
                Case False
                    $sVariable = $sTmp
                Case True
                    $sVariable = $aVariable[1]
            EndSwitch
        Case GUICtrlRead($List_SetGet) = "Set Value"
            $sVariable = $aVariable[0]
        Case GUICtrlRead($List_SetGet) = "Get Value"
            If $sTmp = "" Then
                $sVariable = "$sValue"
            Else
                $sVariable = $sTmp
            EndIf
    EndSelect
    $sVariable = StringReplace($sVariable, "%1", $sTmp)

    Switch StringLower(GUICtrlRead($List_SetGet))
        Case "get value" ; text, password, checkbox, radio and hidden
            If $sType = "text" Or $sType = "password" Or $sType = "hidden" Or $sType = "checkbox" Or $sType = "radio" Then
                If Not $bIndex And $sElementsName <> "" Then
                    $sCommand = StringFormat('%s = _FFGetValueByName("%s", %s)', $sVariable, $sElementsName, $sIndex)
                Else
                    $sCommand = StringFormat("%s = _FFCmd('.%s.%s.value')", $sVariable, $sForm, $sElements)
                EndIf
            EndIf
        Case "set value" ; text, password and hidden
            If $sType = "text" Or $sType = "password" Or $sType = "hidden" Then
                If Not $bIndex And $sElementsName <> "" Then
                    If $sVariable <> '""' Then
                        $sCommand = StringFormat('_FFSetValueByName("%s", %s)', $sElementsName, $sVariable)
                    Else
                        $sCommand = '_FFSetValueByName("' & $sElementsName & '")'
                    EndIf
                Else
                    $sCommand = StringFormat("_FFCmd('.%s.%s.value=%s')", $sForm, $sElements, $sVariable)
                EndIf
            EndIf
        Case "check" ; radio and checkbox
            If $sType = "checkbox" Then
                If Not $bIndex And $sElementsName <> "" And $sFormName <> "" And $sIndex > -1 Then
                    $sCommand = StringFormat('_FFFormCheckBox("%s", true, %s, "name", "%s", "name")', $sElementsName, $sIndex, $sFormName)
                Else
                    $sCommand = StringFormat("_FFCmd('.%s.%s.checked=true')", $sForm, $sElements)
                EndIf
            ElseIf $sType = "radio" Then
                If Not $bIndex And $sElementsName <> "" And $sFormName <> "" And $sIndex > -1 Then
                    $sCommand = StringFormat('_FFFormRadioButton("%s", %s, "name", "%s", "name")', $sElementsName, $sIndex, $sFormName)
                Else
                    $sCommand = StringFormat("_FFCmd('.%s.%s.checked=true')", $sForm, $sElements)
                EndIf
            EndIf
        Case "uncheck" ; checkbox
            If $sType = "checkbox" Then
                If Not $bIndex And $sElementsName <> "" And $sFormName <> "" And $sIndex > -1 Then
                    $sCommand = StringFormat('_FFFormCheckBox("%s", true, %s, "name", "%s", "name")', $sElementsName, $sIndex, $sFormName)
                Else
                    $sCommand = StringFormat("_FFCmd('.%s.%s.checked=false')", $sForm, $sElements)
                EndIf
            EndIf
        Case "click link" ; link
            If Not $bIndex And($sType = "link" Or $sType = "imglink") And StringInStr($sHREF, "javascript:") = 0 Then
                $sCommand = StringFormat("_FFLinkClick('%s')", $sHREF)
            Else
                $sCommand = StringFormat("_FFClick('.%s')", $iLink)
            EndIf
        Case "click element" ; all elements
            If $sType <> "link" And $sType <> "imglink" And $sType <> "javascript" Then
                If Not $bIndex And $sFormName <> "" And $sElementsName <> "" Then
                    $sCommand = StringFormat("_FFClick('.%s.%s[%s]')", $sFormName, $sElementsName, $sIndex)
                Else
                    $sCommand = StringFormat("_FFClick('.%s.%s')", $sForm, $sElements)
                EndIf
            EndIf
        Case "form submit" ; all elements
            If Not $bIndex And $sFormName <> "" Then
                $sCommand = StringFormat('_FFFormSubmit("%s","name")', $sFormName)
            Else
                $sCommand = '_FFFormSubmit( %1)'
                $sCommand = StringReplace($sCommand, "%1", _
                        StringMid($sForm, StringInStr($sForm, "[") + 1, 1) _
                        )
            EndIf
        Case "form reset" ; all elements
            If Not $bIndex And $sFormName <> "" Then
                $sCommand = StringFormat('_FFFormReset("%s","name")', $sFormName)
            Else
                $sCommand = '_FFFormReset(%1)'
                $sCommand = StringReplace($sCommand, "%1", _
                        StringMid($sForm, StringInStr($sForm, "[") + 1, 1) _
                        )
            EndIf
    EndSwitch

    If IsChecked($Menu_Options_Copy) Then ClipPut($sCommand)

    If $sCommand <> "" Then GUICtrlSetData($List_Commands, $sCommand & "|")

    AdlibRegister("_getURL", $iURLTimer)
    Return
EndFunc   ;==>createCommand
;===============================================================================
Func createLogin($iMode)
    Local $sCommand = "", $iForm = -1, $iPassName, $iPassWord

    Local $aCommand[6]
    $aCommand[0] = '_FFSetValueByName("%s",%s)'
    $aCommand[1] = '_FFSetValueByName("%s",%s)'
    $aCommand[2] = '_FFFormSubmit("%s","name")'

    $aCommand[3] = '_FFCmd(".forms[%s].elements[%s].value=%s")'
    $aCommand[4] = '_FFCmd(".forms[%s].elements[%s].value=%s")'
    $aCommand[5] = '_FFFormSubmit(%s)'

    Local $hURL = _GUICtrlTreeView_GetSelection($Tree_Forms)
    Local $sItem = _GUICtrlTreeView_GetText($Tree_Forms, $hURL)
    If $hURL = 0 Then Return 0
    If StringInStr($sItem, "http") = 0 Or StringInStr($sItem, "file:///")Then
        $hURL = _GUICtrlTreeView_FindItem($Tree_Forms, "http", True)
        If $hURL = 0 Then
            $hURL = _GUICtrlTreeView_FindItem($Tree_Forms, "file:///", True)
            If $hURL = 0 Then Return 0
        EndIf
    EndIf

    ; searching a password-input
    Local $hPass = _GUICtrlTreeView_FindItem($Tree_Forms, "TYPE: password", False, $hURL)
    If Not $hPass Then
        GUICtrlSetData($Status, "Can't find input-type: password")
        Return 0
    EndIf
    Local $hPassword = _GUICtrlTreeView_GetParentHandle($Tree_Forms, $hPass)
    Local $sPassword = _GUICtrlTreeView_GetText($Tree_Forms, $hPassword)

    ; getting the form for the password-input
    Local $hForm = _GUICtrlTreeView_GetParentHandle($Tree_Forms, $hPassword)
    Local $sForm = _GUICtrlTreeView_GetText($Tree_Forms, $hForm)

    ; and searching in this form a text-input
    Local $hName = _GUICtrlTreeView_FindItem($Tree_Forms, "TYPE: text", False, $hForm)
    Local $hPassName = _GUICtrlTreeView_GetParentHandle($Tree_Forms, $hName)
    Local $sPassName = _GUICtrlTreeView_GetText($Tree_Forms, $hPassName)

    Local $aArray = StringRegExp($sForm, "forms\[(\d+)\]", 1)
    If Not @error Then $iForm = $aArray[0]
    If $iForm = -1 Then Return 0
    $sForm = StringMid($sForm, StringInStr($sForm, ":") + 2)

    $aArray = StringRegExp($sPassName, "elements\[(\d+)\]", 1)
    If Not @error Then $iPassName = $aArray[0]
    $sPassName = StringMid($sPassName, StringInStr($sPassName, ":") + 2)

    $aArray = StringRegExp($sPassword, "elements\[(\d+)\]", 1)
    If Not @error Then $iPassWord = $aArray[0]
    $sPassword = StringMid($sPassword, StringInStr($sPassword, ":") + 2)

    If($sForm <> "") And($sPassName <> "") And($sPassword <> "") Then
        $aCommand[0] = StringFormat($aCommand[0], $sPassName, "$sUserName")
        $aCommand[1] = StringFormat($aCommand[1], $sPassword, "$sPassWord")
        $aCommand[2] = StringFormat($aCommand[2], $sForm)
    ElseIf $iForm >= 0 Then
        $aCommand[0] = StringFormat($aCommand[3], $iForm, $iPassName, "'" & '" & $sUserName & "' & "'")
        $aCommand[1] = StringFormat($aCommand[4], $iForm, $iPassWord, "'" & '" & $sPassWord & "' & "'")
        $aCommand[2] = StringFormat($aCommand[5], $iForm)
    Else
        Return 0
    EndIf

    Switch $iMode
        Case 0
            $sCommand = $aCommand[0] & "|" & $aCommand[1] & "|" & $aCommand[2]
        Case 1
            $sCommand = $aCommand[0] & "|" & $aCommand[1] & "|" & $aCommand[2]
            $sCommand = '$sUserName = ""|$sPassWord = ""|_FFConnect()|If _FFIsConnected() Then|_FFOpenURL("' & _FFCmd(".location.href") & '")|' & $sCommand & "|EndIf"
        Case 2
            $sCommand = StringReplace($sTemplate_Function, "%name", $aCommand[0])
            $sCommand = StringReplace($sCommand, "%pass", $aCommand[1])
            $sCommand = StringReplace($sCommand, "%submit", $aCommand[2])
            $sCommand = StringReplace($sCommand, "%url", '_FFOpenURL("' & _FFCmd(".location.href") & '")')
    EndSwitch

    If $sCommand <> "" Then GUICtrlSetData($List_Commands, $sCommand)

    If IsChecked($Menu_Options_Copy) Then copyAll2ClipBoard()

    Return 1

EndFunc   ;==>createLogin
;===============================================================================
Func onchangeValue()
    Switch StringLower(GUICtrlRead($Value_Combo))
        Case "$svalue"
            GUICtrlSetState($Input_Variable, $GUI_DISABLE)
            GUICtrlSetData($Input_Variable, "$sValue")
        Case "variable"
            GUICtrlSetState($Input_Variable, $GUI_ENABLE)
            GUICtrlSetData($Input_Variable, "")
        Case "fixed"
            If GUICtrlRead($List_SetGet) = "Get Value" Then
                GUICtrlSetState($Input_Variable, $GUI_DISABLE)
            Else
                GUICtrlSetState($Input_Variable, $GUI_ENABLE)
            EndIf
            GUICtrlSetData($Input_Variable, "")
    EndSwitch

    Return
EndFunc   ;==>onchangeValue
;===============================================================================
Func onchangeAction()
    ;"Set Value|Get Value|Check|Uncheck|Click Link|Click Element|Form Submit|Form Reset"

    Switch StringLower(GUICtrlRead($List_SetGet))
        Case "set value"
            GUICtrlSetState($Value_Combo, $GUI_ENABLE)
            If GUICtrlRead($Value_Combo) <> "$sValue" Then GUICtrlSetState($Input_Variable, $GUI_ENABLE)
        Case "get value"
            GUICtrlSetState($Value_Combo, $GUI_ENABLE)
            If GUICtrlRead($Value_Combo) = "Fixed" Then GUICtrlSetState($Input_Variable, $GUI_DISABLE)
        Case Else
            GUICtrlSetState($Input_Variable, $GUI_DISABLE)
            GUICtrlSetState($Value_Combo, $GUI_DISABLE)
    EndSwitch

    Return
EndFunc   ;==>onchangeAction
;===============================================================================
Func _getURL()
    If Not IsLoaded() Then
        GUICtrlSetState($Button_Analyze, $GUI_DISABLE)
    Else
        GUICtrlSetState($Button_Analyze, $GUI_ENABLE)
    EndIf
    Local $sURL = _FFCmd(".location.href", 5000)
    WinSetTitle($Win_Main, "", $sURL & " - " & $sGUI_Title)
    IsLoaded()
    GUICtrlSetTip($Input_URL, $sURL)
    If StringLen($sURL) > 50 Then
        GUICtrlSetData($Input_URL, StringLeft($sURL, 50) & "...")
    Else
        GUICtrlSetData($Input_URL, $sURL)
    EndIf
EndFunc   ;==>_getURL
;===============================================================================
Func Toggle($item)
    If IsChecked($item) Then
        GUICtrlSetState($item, $GUI_UNCHECKED)
        Return False
    Else
        GUICtrlSetState($item, $GUI_CHECKED)
        Return True
    EndIf
EndFunc   ;==>Toggle
;===============================================================================
Func IsChecked($id)
    Return BitAND(GUICtrlRead($id), $GUI_CHECKED)
EndFunc   ;==>IsChecked
;===============================================================================
Func IsLoaded()
    Return _FFLoadWait()
EndFunc   ;==>IsLoaded
;===============================================================================
Func reconnectFF()
    AdlibRegister("_getURL")
    If $_FF_GLOBAL_SOCKET <> -1 Then
        _FFDisConnect()
        GUICtrlSetData($Status, "")
        AdlibRegister("_getURL", $iURLTimer)
        Return
    EndIf
    GUICtrlSetData($Status, "Connecting to FireFox ...")
    Sleep(300)
    _FFConnect()
    If $_FF_GLOBAL_SOCKET = -1 Then
        GUICtrlSetData($Status, "ERROR: Can't open connection to FireFox")
        Return
    Else
        GUICtrlSetData($Status, "")
        AdlibRegister("_getURL")
        Return
    EndIf
EndFunc   ;==>reconnectFF
;===============================================================================
Func TreeSearchItem($sItem)
    If _GUICtrlTreeView_FindItem($Tree_Forms, $sItem) <> 0 Then Return 1
    Return 0
EndFunc   ;==>TreeSearchItem
;===============================================================================
Func copyAll2ClipBoard()
    Local $tmp = ""
    For $i = 0 To _GUICtrlListBox_GetCount($List_Commands) - 1
        $tmp &= _GUICtrlListBox_GetText($List_Commands, $i) & @CRLF
    Next
    ClipPut($tmp)

    _ReduceMemory()

    Return
EndFunc   ;==>copyAll2ClipBoard
;===============================================================================
Func writeINI($sINI)
    IniWriteSection($sINI, "misc", "URLTimer=" & $iURLTimer)

    Local $i
    For $i = 0 To UBound($aMenu_ViewTrans) - 1
        If IsChecked($aMenu_ViewTrans[$i][0]) Then ExitLoop
    Next

    Local $aData[9][2] = [["Append", IsChecked($Menu_Options1)], _
            ["Transparency", $i], _
            ["GetForm", IsChecked($Menu_Options_GetForm)], _
            ["GetLinks", IsChecked($Menu_Options_GetLinks)], _
            ["GetLinksName", IsChecked($Menu_Options_GetLinksName)], _
            ["GetLinksID", IsChecked($Menu_Options_GetLinksID)], _
            ["GetLinksHASH", IsChecked($Menu_Options_GetLinksHASH)], _
            ["GetLinksTarget", IsChecked($Menu_Options_GetLinksTARGET)], _
            ["CopyToClipboard", IsChecked($Menu_Options_Copy)]]
    IniWriteSection($sINI, "options", $aData, 0)

    Local $aData2[4][2] = [["UseIndex", IsChecked($Select_UseIndex)], _
            ["Action", _GUICtrlComboBox_GetCurSel($List_SetGet)], _
            ["Value", _GUICtrlComboBox_GetCurSel($Value_Combo)], _
            ["Variable", GUICtrlRead($Input_Variable)]]
    IniWriteSection($sINI, "command_options", $aData2, 0)

    IniWriteSection($sINI, "templates", "Function=" & $sTemplate_Function)
EndFunc   ;==>writeINI
;===============================================================================
Func readINI($sINI)
    $iURLTimer = IniRead($sINI, "misc", "URLTimer", 5000)
    If $iURLTimer < 1000 Then $iURLTimer = 5000

    Local $tmp = IniRead($sINI, "options", "Transparency", 0)
    GUICtrlSetState($aMenu_ViewTrans[$tmp][0], $GUI_CHECKED)
    WinSetTrans($Win_Main, "", $aMenu_ViewTrans[$tmp][1])

    GUICtrlSetState($Menu_Options1, IniRead($sINI, "options", "Append", 0))
    GUICtrlSetState($Menu_Options_GetForm, IniRead($sINI, "options", "GetForm", 1))
    ;GUICtrlSetState($Menu_Options_GetFormID, IniRead($sINI, "options", "GetFormID", 0))
    GUICtrlSetState($Menu_Options_GetLinks, IniRead($sINI, "options", "GetLinks", 1))
    GUICtrlSetState($Menu_Options_GetLinksName, IniRead($sINI, "options", "GetLinksName", 0))
    GUICtrlSetState($Menu_Options_GetLinksID, IniRead($sINI, "options", "GetLinksID", 0))
    GUICtrlSetState($Menu_Options_GetLinksHASH, IniRead($sINI, "options", "GetLinksHASH", 0))
    GUICtrlSetState($Menu_Options_GetLinksTARGET, IniRead($sINI, "options", "GetLinksTarget", 0))
    GUICtrlSetState($Menu_Options_Copy, IniRead($sINI, "options", "CopyToClipboard", 1))
    GUICtrlSetState($Select_UseIndex, IniRead($sINI, "command_options", "UseIndex", 0))
    ;GUICtrlSetData($Input_Socket, IniRead($sINI, "command_options", "Socket", "$Socket"))
    _GUICtrlComboBox_SetCurSel($List_SetGet, IniRead($sINI, "command_options", "Action", 0))
    _GUICtrlComboBox_SetCurSel($Value_Combo, IniRead($sINI, "command_options", "Value", 0))
    GUICtrlSetData($Input_Variable, IniRead($sINI, "command_options", "Variable", ""))

    $sTemplate_Function = IniRead($sINI, "templates", "Function", '')
    If $sTemplate_Function = '' Then $sTemplate_Function = 'Func _FFLogin($sUserName, $sPassWord, $sSuccses)|If _FFIsConnected() Then|%url|If @error Then Return 0|If %name = 0 Then Return 0|If %pass = 0 Then Return 0|%submit|If @error Then Return 0|_FFLoadWait()|If _FFSearch($sSuccses) Then Return 1|EndIf|Return 0|EndFunc'

    onchangeAction()
    onchangeValue()
EndFunc   ;==>readINI
;===============================================================================
Func _ReduceMemory($i_PID = -1)
    Local $ai_Return
    If $i_PID <> -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf

    Return $ai_Return[0]
EndFunc   ;==>_ReduceMemory

Func Msg($s)
    MsgBox(64,"",$s)
EndFunc
Link to comment
Share on other sites

  • 2 weeks later...

I've started tinkering and reexamined both FF.au3 and _FF_DM.au3 thats based on it. Its funny, I actually only understand about 1/3 of my own code but it works in a limited way. I've managed to access the firefox places api using Thorstens code as a starting point.

The download manager api he uses is here.

https://developer.mozilla.org/en/NsIDownloadManager

while the bookmarking (places) one that I'm accessing is here.

https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsINavBookmarksService

At this point I can use any of the methods as long as it takes one or more strings and returns a string or null. Most are like that, Getting indexes, creating subfolders, renaming them. Most of it you already need to know the internal ID of the bookmark in question. I've used a plugin called "SQLite Manager" to give me this info for my testing.

The key methods of the api I need to find out this info via my script return an array of results, not a single string. So I am unable at this point to use them.

This limit I believe is due to my limited understanding of the full scope of what the code is doing. Remember I said I only understand 1/3 of my own code. I can duplicate some stuff but don't yet know why it was done the way it was.

...

That was a couple weeks ago. Some further tinkering and messing around and I've only just discovered what he is actually doing with the _FFCmd command. Ah. I get it. ;) I was blindly using it without understanding it. I see how the one download func is using multiple java commands to build and return a string so it can be converted into an array on the autoit side of things that he then returns to us mere mortals. Until this point I did not know it was java commands strung together. I had just replaced what I thought of as appropriate and it worked. The use of Mozrepl and a couple other observations suddenly make sense. I have not duplicated it yet but I can now see the path to what I want. Granted, now I need to learn a bit of basic java.

I've played around for a few min with putty connected to Mozrepl to set vars and see how some basic java things work and then tested with _FFCmd to get the same results from autoit. I can even inject data with putty into the browser java universe and then pull it out with autoit. Cool. Now I just need to play with arrays and strings in java.

I've got some ideas for a gui and may not use the bookmarks api after all. In my case I could store the data locally. but its been nice digging in and learning new things.

So what was the point of my rambling post..... Two things.

1. I'm going to continue messing with the places api as It has become very interesting, I might not end up using it for this project but I'll continue with my tinkering with it as it may be useful for other projects. Is there an already built UDF for the firefox places api that I could examine? I was unable to find anything.

2. I've only just dug deep enough to understand what must have gone into the creation of both FF.au3 and _FF_DM.au3. I just wanted to say Thank You.

:)

Link to comment
Share on other sites

  • 3 weeks later...

I've spent about another 3 or 4 days on this since my last post to this thread. I'm happy to say I now have full access to the firefox bookmarks via the _FFCMD command from FF.au3 and the Firefox api services.

My code, while it works, is a bit crude. I've learned a lot along the way hence the mess. I never did find a UDF for this to study but I managed to figure it out with following Mozilla developer centre pages.

Firefox treats all bookmarks, folders, separators the same. They are items but with different properties. Reading them, creating and manipulating folders can all be done with info on the following two pages.

https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsINavBookmarksService

https://developer.mozilla.org/en/Manipulating_bookmarks_using_Places

Creation of actual bookmarks needs a command from there but it also needs an nsIURI object. These can be created from the following service.

https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIIOService

Other things such as history, tags and so forth use more services. I've not yet looked into them. The overall Places api can be found at the following url.

https://developer.mozilla.org/en/Places

Have Fun.

Link to comment
Share on other sites

Where is the error

Thanks in advance

$url = "[url="http://www.autoit.de/"]http://www.autoit.de[/url]"
If _FFStart($url,"default",1, false,$proxy) then

_FFFrameEnter(2)
        MsgBox(0,"Frame 2 URL", _FFCmd(".location.href") )
        _FFFrameLeave()
        MsgBox(0,"Top URL",_FFCmd(".location.href") )
    EndIf

Result :

_FFStartProcess: ""C:\Program Files\Mozilla Firefox\firefox.exe" -new-window "http://www.autoit.de" -repl 4242

_FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3

_FFConnect: AutoIt: 3.3.6.1

_FFConnect: FF.au3: 0.6.0.1b-5

_FFConnect: IP: 192.168.1.47

_FFConnect: Port: 4242

_FFConnect: Delay: 2ms

_FFConnect: Socket: 1660

_FFConnect: Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10

__FFSendJavascripts: Sending functions to FireFox .

__FFWaitForRepl ==> MozRepl Exception: !!! [Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"

......... done

_FFLoadWait: . loaded in 13ms

__FFSend: try{window.content.top.frames[2].document.location.href}catch(e){'_FFCmd_Err';};

__FFRecv: _FFCmd_Err

__FFSend: try{window.content.top.document.location.href}catch(e){'_FFCmd_Err';};

__FFRecv: http://www.autoit.de/

+>20:52:29 AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 12.478

Link to comment
Share on other sites

  • 2 weeks later...

This should work:

#include <FF.au3>
$url = "http://www.autoit.de"
If _FFStart($url) Then
    _FFFrameEnter(1) ;0-n index
    MsgBox(0, "Frame 2 URL", _FFCmd(".location.href"))
    _FFFrameLeave()
    MsgBox(0, "Top URL", _FFCmd(".location.href"))
EndIf

Where is the error

Thanks in advance

$url = "[url="http://www.autoit.de/"]http://www.autoit.de[/url]"
If _FFStart($url,"default",1, false,$proxy) then

_FFFrameEnter(2)
        MsgBox(0,"Frame 2 URL", _FFCmd(".location.href") )
        _FFFrameLeave()
        MsgBox(0,"Top URL",_FFCmd(".location.href") )
    EndIf

Result :

_FFStartProcess: ""C:\Program Files\Mozilla Firefox\firefox.exe" -new-window "http://www.autoit.de" -repl 4242

_FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3

_FFConnect: AutoIt: 3.3.6.1

_FFConnect: FF.au3: 0.6.0.1b-5

_FFConnect: IP: 192.168.1.47

_FFConnect: Port: 4242

_FFConnect: Delay: 2ms

_FFConnect: Socket: 1660

_FFConnect: Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10

__FFSendJavascripts: Sending functions to FireFox .

__FFWaitForRepl ==> MozRepl Exception: !!! [Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"

......... done

_FFLoadWait: . loaded in 13ms

__FFSend: try{window.content.top.frames[2].document.location.href}catch(e){'_FFCmd_Err';};

__FFRecv: _FFCmd_Err

__FFSend: try{window.content.top.document.location.href}catch(e){'_FFCmd_Err';};

__FFRecv: http://www.autoit.de/

+>20:52:29 AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 12.478

Link to comment
Share on other sites

LOULOU:

Fifth argument of _FFStart function is IP OF MOZREPL! You can't set there proxy IP!

From FF.au3:

Func _FFStart($sURL = "about:blank", $sProfile = "default", $iMode = 1, $bHide = False, $IP = "127.0.0.1", $iPort = 4242)
$IP          - Optional: (Default = "127.0.0.1") : IP of MozRepl

Set there default, or don't mess with it all!

I suppose you've downloaded MozRepl, which is absolutely necessary to work with FF.au3.

Now, I assume you want (by putting $proxy in fifth argument) to further connect using proxy. The way to do it is:

1. Use function _FFPrefSet

2. Read THIS and THIS. Also remember, that "network.proxy.type must be set to 1 for this preference to take effect." (from the first source)

Link to comment
Share on other sites

  • 2 weeks later...

I started to study the examples of the FF3.chm that is in the first page and I wanted to test this one:

#Include <FF.au3>

_FFStart()

If _FFIsConnected() Then
    ; add a new tab with an URL
    _FFTabAdd("http://ff-au3-example.thorsten-willert.de/")
    sleep(3000)
    ; add a new blank tab and bring it to front
    _FFTabAdd(default,true)
    Sleep(3000)
    ; select the tab with "FF" in the label
    _FFTabGetSelected("FF","label")
    ; shows the number of tabs
    MsgBox(64,"Number of tabs:",_FFTabGetLength())
    ; closing all tabs except the current
    _FFTabCloseAll()
    Sleep(3000)
    ; closes FireFox
    _FFQuit()
EndIf

But I have an error with _FFTabCloseAll because it is neither declared in FF.au3 v0.6.0b -taken from the first post of the thread- nor in FF_v0.6.0b-5.au3 -taken from here . What's the latest version of FF.au3? Or in any case, is there a chm that corresponds to the latest version or the version posted in the first post of this thread? Thanks!

Link to comment
Share on other sites

Is there any way to Attach or Connect to a Specific TAB thats already open in Firefox..??

Sure there is!

But it's slightly more complicated, so on that level you'll be using practically only '_FFCmd' function. There's huge amount of ways you can interact with Firefox (https://developer.mozilla.org/ - everything u'll find here). But straight to the point:

#include <FF.au3>
#include <Array.au3>
#include <winapi.au3>

Global $FF_HANDLE, $FF_WINDOWS[1] = [0]

FF_WinzBefore() ; function of mine, dont bother
_FFStart()
FF_GetHandle()  ; function of mine, dont bother, just a better way to get firefox hwnd without blocking input, as in _FFWindowGetHandle function

Do
    Sleep(100)
Until WinActive($FF_HANDLE)

_FFCmd("window.content.document = null;")
_FFCmd("var wcd = window.content.document; var fset = wcd.createElement('frameset'); var f1 = wcd.createElement('frame'); var f2 = wcd.createElement('frame');")
_FFCmd("fset.cols='500, *'; fset.border = '5';")
_FFCmd("f1.src = 'http://youtube.com'; f2.src = 'http://www.google.com'")
_FFCmd("fset.appendChild(f1); fset.appendChild(f2);")
_FFCmd("wcd.body.appendChild(fset);")

Do
    Sleep(100)
Until Int(_FFCmd('gBrowser.webProgress.busyFlags')) = 0
Sleep(1000) ; because busyFlags LIE! its really nasty issue at some point

MsgBox(0, '', "we're here so far :]")

_FFCmd("window.content.frames[0].document.getElementById('masthead-search-term').value = 'Now its time for fun with tabs!';" & _
"window.content.frames[1].document.getElementsByName('q')[0].value = 'Now its time for fun with tabs!'")
Sleep(1000)


For $i =  - 1 to _FFCmd("window.content.frames.length") ; stands for 2
    _FFCmd('gBrowser.addTab("http://www.google.com")')
Next

$sTring = InputBox('', "Notice that I'm not switching between tabs in any moment!", 'put your question here')

_FFCmd('for (var i = 1; i < gBrowser.mTabs.length; i++) { '                 & _
    "gBrowser.mTabs[i].linkedBrowser.contentwindow.document.getElementsByName('q')[0].value = '" & $sTring  & "';" & _
    "gBrowser.mTabs[i].linkedBrowser.contentwindow.document.forms[0].submit();};")

MsgBox(0, '', "And nothing in my sleeves!" & @CRLF  & @CRLF & 'Use some [Ctrl]+[Tab] now.' )
Sleep(2000)
MsgBox(0, '', "Now it's time for the best part!")



$start = TimerInit()
$x = 1
Do
    _FFCmd('for (var i = 0; i < gBrowser.mTabs.length; i++) {gBrowser.mTabs[i].hidden = ' & $x & '};')
    If $x Then
        $x = 0
    Else
        $x = 1
    EndIf
    Sleep(50)
Until TimerDiff($start) >= 5500

    If $x = 0 Then _FFCmd('for (var i = 0; i < gBrowser.mTabs.length; i++) {gBrowser.mTabs[i].hidden = 1')




; DONT bother with this; just a helpful functions of mine
; DONT bother with this; just a helpful functions of mine
; DONT bother with this; just a helpful functions of mine
Func FF_WinzBefore()
            Local $array = _WinApi_EnumWindowsTop()
        For $i = 1 to $array[0][0]
            If $array[$i][1] = "MozillaUIWindowClass" Then
                _ArrayAdd($FF_WINDOWS, $array[$i][0])
            EndIf
        Next
        _ArrayDelete($FF_WINDOWS, 0)
EndFunc

Func FF_GetHandle()
    ConsoleWrite('Getting Firefox handle...')
    While True

        Local $recv = 0, $array = _WinApi_EnumWindowsTop()
        For $i = 1 to $array[0][0]
            If $array[$i][1] = "MozillaUIWindowClass" Then
                If _ArraySearch($FF_WINDOWS, $array[$i][0]) = -1 Then
                    $FF_HANDLE = $array[$i][0]

                    ConsoleWrite(@CRLF)
                    Return 1
                EndIf
            EndIf
        Next

        ConsoleWrite('.')
        Sleep(50)

    WEnd
EndFunc

Latest FF.au3 version is here: http://www.thorsten-willert.de/Themen/FFau3/FF.au3/FF.au3?a, yet it doesn't contains 'TabCloseAll' function. You can try following code:

_FFCmd('for ( var i = 1; i < gBrowser.mTabs.length; i++) {gBrowser.removeTab(gBrowser.mTabs[i])}')
, which close all tabs excluding first, or
_FFCmd('gBrowser.removeAllTabsBut(gBrowser.selectedTab);')
, closing all tabs excluding currently active (selected).
Link to comment
Share on other sites

  • Developers

@zxc3, What about you only post your question 1 time instead of 3 times of which one topic in examples and one hijack!

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I started to study the examples of the FF3.chm that is in the first page and I wanted to test this one:

#Include <FF.au3>

_FFStart()

If _FFIsConnected() Then
    ; add a new tab with an URL
    _FFTabAdd("http://ff-au3-example.thorsten-willert.de/")
    sleep(3000)
    ; add a new blank tab and bring it to front
    _FFTabAdd(default,true)
    Sleep(3000)
    ; select the tab with "FF" in the label
    _FFTabGetSelected("FF","label")
    ; shows the number of tabs
    MsgBox(64,"Number of tabs:",_FFTabGetLength())
    ; closing all tabs except the current
    _FFTabCloseAll()
    Sleep(3000)
    ; closes FireFox
    _FFQuit()
EndIf

But I have an error with _FFTabCloseAll because it is neither declared in FF.au3 v0.6.0b -taken from the first post of the thread- nor in FF_v0.6.0b-5.au3 -taken from here . What's the latest version of FF.au3? Or in any case, is there a chm that corresponds to the latest version or the version posted in the first post of this thread? Thanks!

You need to read the first post, _FFTabCloseAll has been replaced by _FFTabClose.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I have multiple autoit processes that need to each create & attach to their own tab and perform tasks independently of each other in their tab like navigating to diff urls without having the other tabs being focused or interrupted..

I need to change each separate tab url without having to focus each specific tab, is there a way to change or send a url to a tab by its index # without focusing it..??

How exactly can I do this..?

Edited by cypher175
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...